Pat Farrell wrote:I'm not sure what you are asking. Generally, you can use someone else's cache implementation, or you can write your own.
I like one that I've implemented, its a WorkingSetCache based on Denning's work on locality and cache efficiency. Open source code at
To get good performance, you have to engineer the design of the cache with the production environment. For example, many cache schemes use a LRU (least recently used) which is simple to program, explain and test. It usually works fairly well, but can fail badly in some cases.
Pat Farrell wrote:I make using the cache transparent to users (aka other developers). Its an engineering decision which objects get cached. I put the cache in the BusinessObject layer, as part of the ORM. This approach is not 100% transparent to the users, for instance, if your Person object is cached, the normal access to an object via its primary key is
Person aper = Person.getFromId(primkey);
instead of the usual
Person aper = new Person(primkey);