-
1. Re: Service Locator Pattern Client-side
darranl May 10, 2004 12:25 PM (in response to nickshah)Doesn't really stop you doing it for caching but singletons on the server side should not be relied on as the application server may run multiple JVMs or use multiple classloaders that would result in multiple instances of the singleton.
-
2. Re: Service Locator Pattern Client-side
jae77 May 10, 2004 1:28 PM (in response to nickshah)we're currently doing this in our application. (server side singleton).
provided that you are building an instance of the class using a static initializer, you shouldn't have any issues. (this also assumes that your interfaces are packaged seperately and won't be cycled on a hot-deploy).
we originally had problems b/c instead of using the static initializer, only created the instance if the instance variable was null. switching to the static initializer solved that problem and i have yet to encounter any other ill-effects.