• Post Reply Bookmark Topic Watch Topic
  • New Topic

initialize DAO Factory  RSS feed

 
Kiki Tsang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi experts,
I'm new to EJB and I am currently implementing a project using SessionBean + DAO. I want to create a DAOFactory that will return different DAO with connections set in the returned DAO. I want to initialize the DAO Factory with a file containing something similar to the following xml:
<daoFactory>
<dao daoName="daoName1" dataSrcName="datasource1" class="com.company.dao.DAOClass1"/>
<dao daoName="daoName2" dataSrcName="datasource2" class="com.company.dao.DAOClass2"/>
</daoFactory>
where should I do this initialization of the factory (bootstraping)? And is it corret for me to read from a file?
[ May 03, 2004: Message edited by: Kiki Tsang ]
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you are looking to implement a limited form of IoC (Inversion of Control). In which case, I would suggest you take a look at using the Spring Framework. It handles basically what you are trying to do and a lot more.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!