which scope should a DAO typically have.

Posted by Andreas Petersson on Stack Overflow See other posts from Stack Overflow or by Andreas Petersson
Published on 2008-10-14T12:50:59Z Indexed on 2010/05/18 4:00 UTC
Read the original article Hit count: 342

its out of question that a dao will not hold any state.

however, for easiest access to the class, is it better to use prototype( = new every time) or singleton?

simple object creation is cheap for dao's.. it typically only holds a sessionfactory, accessing the object from a list of singletons may be equally expensive.

clarfication: the focus of this question is, if there is a common convention to the scoping of daos.

© Stack Overflow or respective owner

Related posts about dependency-injection

Related posts about dao