O'Reilly logo

Pattern-Oriented Software Architecture Volume 3: Patterns for Resource Management by Prashant Jain, Michael Kircher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3 Resource Lifecycle

“Seek not, my soul, the life of the immortals; but enjoy to the full the resources that are within thy reach”

Pindar

Once a resource has been acquired, its lifecycle must be managed effectively and efficiently. Managing a resource involves making it available to users, handling inter-resource dependencies, acquiring any dependent resources if necessary, and finally releasing resources that are no longer needed.

The Caching (83) pattern describes how the lifecycle of frequently-accessed resources can be managed to reduce the cost of re-acquisition and release of these resources, while maintaining the identity of the resources. It is a very common pattern that is used in a large number of highly-scalable enterprise solutions. In contrast to the Caching pattern, the Pooling (97) pattern optimizes acquisition and release of resources, while not maintaining the identity of the resources. Pooling is therefore preferable for stateless resources, as they require little or no initialization. Similar to Caching, Pooling is also used widely and includes examples such as pooling of components in component platforms and pooling of threads in distributed applications. Both Caching and Pooling are only applicable to reusable resources. Both patterns typically apply to exclusive reusable resources that are used serially by users. However, in some cases it may make sense to use Caching or Pooling for concurrently-accessible reusable resources. In such cases, both Caching and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required