> > Ummm urrrk I have a big problem with assuming > there > > is only one registered object of each class. If > you > > return a collection of all registered objects of a > > requested class this is ok with me, although I > don't > > see yet how useful it is. > > This is clearly for "singleton" programming,
Then I think it will lead to unnecessary limitations in the future. JBoss mq was originally developed with several singletons and static class references. One result is that it is now untestable: there is no way to set up instances with each PM for testing, without removing the "standard" one. Also it prevents anyone from using more than one PM at once. If this had been set up with visible object references from the start, we would have a more flexible and testable system, with a minimal increase in complexity. > > > Are you keeping track of > > inheritance or returning objects only of the exact > > requested class (i.e. interfaces don't work) > > interfaces ok > > > I think anything that encourages people to use or > > assume singletons is a bad idea. > > you mean JMX is a bad idea? ??? JMX doesn't say anything about singletons, you can have zillions of instances of any class, each with its own unique object name. We can have lots of ConnectionFactoryLoaders going at once, they are all of the same class, just different instances. JINI doesn't try to force you into singletons either, all the lookup services I've seen provide a nice query facility based on Entry, and return a Collection of matching results. Something like this is fine with me. Something that picks one instance randomly is not. > > don't feel you need to expand. > > > What problem are you trying to solve here? > > read my first post. Can you give an example of a class that you want to have only one instance of and lookup in this way? How do you know you will never need more than one instance of this class? david j > > marcf ______________________________________________________________________ View this jboss-dev thread in the online forums: http://jboss.org/forums/thread.jsp?forum=66&thread=6254 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
