Caching equals pools of objects with state, i.e. sessions & EJB. You need a specific instance however.
Pooling gives any instance and no particular state is required, i.e. JDBC, threads and servlets.
--------------------------------------------------------------------------------------------------------
Caching means you keep the old data but do not get new data. Pooling means you check for new ones and retrieve them at periodic intervals.
--------------------------------------------------------------------------------------------------------
A pool is a collection of stateless objects. A cache is a collection of stateful objects.
The main distinction between a cache and a pool is what is contained in them. In other words, when you retrieve an object from a cache or a pool, do you need a specific object, or will any object do? If you need a specific object, then each object maintains state; hence, you need to use a cache. If, on the other hand, you can use any object, then the objects do not maintain state and you can use a pool.
Pooling gives any instance and no particular state is required, i.e. JDBC, threads and servlets.
--------------------------------------------------------------------------------------------------------
Caching means you keep the old data but do not get new data. Pooling means you check for new ones and retrieve them at periodic intervals.
--------------------------------------------------------------------------------------------------------
A pool is a collection of stateless objects. A cache is a collection of stateful objects.
The main distinction between a cache and a pool is what is contained in them. In other words, when you retrieve an object from a cache or a pool, do you need a specific object, or will any object do? If you need a specific object, then each object maintains state; hence, you need to use a cache. If, on the other hand, you can use any object, then the objects do not maintain state and you can use a pool.
Comments
Post a Comment