wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Caching in factory.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Caching in factory...." Watch "Caching in factory...." New topic

Caching in factory....

Gaurav Jain
Ranch Hand

Joined: Mar 11, 2004
Posts: 108
Is it a good practise to cache the object which is created using a factory?
For example i create a Customer DAO using the DAO factory then after creating it i store it in a hashmap in the factory and then when a different request comes instead of creating the CustomerDAO again i serve the same from the hashmap.
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
It is an attractive option as long as your cached object is designed thread safe or multithreading is not an issue in your application.

I think, therefore I exist -- Rene Descartes
I agree. Here's the link: http://aspose.com/file-tools
subject: Caching in factory....
Similar Threads
Simoltaneous insertion giving problem.
Caching of Database Access Objects's possible?
How to work with multiple persistence units
I have to use EJB in my project. Where?
factory using a factory