Ack! If you're just starting out, don't use the DAO framework. :-) Use Spring or use your own simple classes for DAOs. They don't really need a framework. But yes, I'd instantiate the DAOs within the service.
If you're already using the DAO framework, then the answer to both of your questions are: >>Do you have dao initialization (if you use dao) in MyService >>constructor? Something like this: Yes >>Is dao initialization cheap operation too? Yes >> Should I use singleton, No Cheers, Clinton -----Original Message----- From: Dmitry Neverov [mailto:[EMAIL PROTECTED] Sent: October-23-07 8:13 PM To: [email protected] Subject: Re: question on com.ibatis.jpetstore.service.* Thanks for answers! Do you have dao initialization (if you use dao) in MyService constructor? Something like this: private MyService(){ someDao = (SomeDao) daoManager.getDao(someDao.class); } Is dao initialization cheap operation too? Should I use singleton, if I use dao (to create new dao only once)? -- Best regards, Dmitri Neverov
