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.

see also:


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -