Origin: |
Grand 98 |
Reason: |
Allow fast or efficient access to objects that are
slow or expensive to obtain.
|
Synopsis: |
Retain for later access a reference to a slow or expensive to obtain
object once it has been constructed.
|
Example: |
A program allows users to retrieve information about a product.
The information about the product comes from a variety of
sources that are slow to access.
|
Solution: |
ObjectKey |
Identifies an object to be fetched from the Cache.
|
Product ID |
CacheManager |
Objects are stored into and retrieved from the Cache
by this class.
|
|
ObjectCreator |
Class(es) responsible for creating objects not in the Cache.
|
|
Cache |
Container for cached objects.
Has methods to insert, retrieve, and remove objects.
|
|
|
See also: |
ObjectPool
(a CacheManagement without IDs)
|