• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

initialize DAO Factory  RSS feed

 
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 ]
 
Ranch Hand
Posts: 2713
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!