ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject RE: question on com.ibatis.jpetstore.service.*
Date Wed, 24 Oct 2007 03:12:36 GMT
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:neverov_dg@nkmk.ru] 
Sent: October-23-07 8:13 PM
To: user-java@ibatis.apache.org
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


Mime
View raw message