Java singleton class vs JSF application scoped managed bean - differences? -
is there difference using singleton class , application scoped managed bean hold application data?
i need lookup jndi ressources such remote bean interfaces , therefore wrote myself singleton cache references , allow single references. (servicelocator)
i opened website in 2 different browsers , singleton got initialized once. assume application scope?
any other benefits of application scope managed bean being able access properties in jsf?
singletons not unit testable nor abstractable nor extendable. singletons unnecessarily complex reliably create , maintain if sole purpose have application scoped data (at least, if really want fullworthy singleton for reason -most starters don't understand singleton supposed be).
"just create one" application scoped managed bean simpler develop, test , maintain. jsf framework guarantee 1 instance created , reused during web application's lifetime.
Comments
Post a Comment