Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB and other Java EE Technologies and the fly likes using abstract DAO factory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "using abstract DAO factory" Watch "using abstract DAO factory" New topic
Author

using abstract DAO factory

Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi all:
if abstract DAO factory frame work is used in a multi- threaded J2EE project, when is it appropriate to cach a single object and return it over and over again, vs. retruning a brand new object.
for example:
//cached object
abstract DAOFactory
{
privte EmployeeDAO MyEmployeeDAO = new EmplyeeDAO();
public EmplyeeDAO getEmplyeeDAO();
{ return MyEmployeeDAO;}
}
vs.
//new object
abstract DAOFactory
{
public EmplyeeDAO getEmpoyeeDAO()
{ return new EmplyeeDAO();}
}
I really appreciate it if someone can explain to me in what situation should I use which technique, and if there is any performance implication in using any of them.
thanks


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: using abstract DAO factory
 
It's not a secret anymore!