The reason I don't like this is because I guess it can lead to quite some problems and it is not realy needed.

Just imagine your app uses HiveMind and some api uses HiveMind internally but does not document (it is just internal why should it?). Both register with setDefault(). Than you have a problem which is not realy easy to find.

The same can happen everywhere where there are different ClassLoaders. Think of a tomcat setup where HiveMind is in the RootClassLoader. Imagine two different web-apps use HiveMinde (and I think this will be no rare case). Each registers its own Registry. Both will end up sharing one Registry and which one is more or less a matter of luck. This is realy hard to debug.

Both Service and user code which use the getDefault() will be more or less useless.

You also don't realy need the getDefault(). Services should take the Registry to which they belong from the initialize() method or let it set as a property. And user code should provide its own way to access its service. A user defined static method could be enough (its not realy hard to implement).

So I want to recommend (because HiveMind is quite new) to just remove the methods or deprecate them, before users start using them.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to