Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This chapter shows how to use an implementation of a common pattern—the use of a pool. Pools typically serve one of two roles—either as a logical representation of a pool, or as a performance enhancement by way of a cache implementation. If a pool represents a logical pool, you should feel free to use the pattern immediately—for example, an application for reserving hotel rooms might use a pool to track the available rooms. If a pool represents a cache of some sort, it should be added to an application later rather than sooner to avoid premature optimization.
Pools are commonly used as a performance enhancement for managing connections to a database. The next chapter will look at a specific pool designed for managing database-specific resources.