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]