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 ]
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.