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

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -