Oops. I forgot to call factory.getObject() on the factory that I get out of the map, but you get the idea. :-)
-----Original Message----- From: James Carman [mailto:[EMAIL PROTECTED] Sent: Sunday, May 14, 2006 8:16 AM To: [email protected] Subject: Changes to BuilderFactory... All, Howard came up with an idea a while back. Instead of using reflection to build objects in BuilderFactory, why don't we have BuilderFactory generate a class via Javassist which builds the object? It'd look something like this: public Object createCoreServiceImplementation(ServiceImplementationFactoryParameters params) { if( !factoryMap.containsKey( params.getServiceId() ) { // Dynamically generate a factory class and put it in the map. } return ( Factory )factoryMap.get( params.getServiceId() ); } I've implemented it before in my "Syringe" project and it works quite nicely. Of course, this is really only useful for non-singleton services. But, for singleton services, it shouldn't be too much overhead. What do you guys think? James --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
