java ee - DAO classes Singleton or Prototype Which is the best approach -


i working on dao layer , writing classes. these classes injected in service layer using spring ioc. best approach singleton/prototype (dao classes not have state )

if don't have state, doesn't matter much. leave them singletons, won't have multiple unnecessary instances of same dao.

note that, if services singletons, making dao prototypes create 1 instance per service it's injected anyway.


Comments

Popular posts from this blog

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -