Hi Rienaers,
While working thru our code base I have detected several kinds of "singletons" (some of them I would not call them a singleton):
1. the classical singelton - a single instance of class (maybe created lazily or not) with the typical static getInstance() method (sometimes it has a different name) with fields (state)
2. the static singleton - this a class with only static methods and static fields carrrying some state
3. the pseudo classical singleton - a single instance of a class with getInstance() but without fields (state)
4. the utility singleton - a class with only static methods without fields (state)
1. and 2. are "real" singletons (they have some state). At these singletons we need to look a little bit closer when we also want to use them within RAP. For them we can use SessionSingletonProvider and SingletonProvider.
How about 3. and 4., especially 3. ?
Should we transform 3 to 4 (no more getInstance(), just static methods)?
Or …
Should the getInstance() method always be named getInstance()?
Opinions, feedback, ..
Tschüß,
Stefan