Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract dao factory

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all:
I have a question regarding using abstract dao factory design concept in j2ee application. If I am using abstract dao factory to return dao objects, is it appropriate to make the facotory return the sames objects over and over again, or to return a new object?
for example:
public DAOFatory
{
FirstDAO first = new FirstDAO();
//returning the same dao object
public FirstDAO getFirstDAO()
{return first;}
//returing a brand new dao
public FirstDAO getFirstDAO()
{return new FirstDAO();}
}
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic