Hey Baz, we're working on 2 things that I think will help you here. The first one is an ApplicationContextUtils class that will allow you to locate instances of beanFactories from default or named keys in specified scopes. eg: getNamedContext('myBeanFactory',application). So you can throw an instance of coldspring.context.util.ApplicationContextUtils into your instance variables and use it to access the factory (Yeah, static methods would be nice there...)

The other thing we'll working on is FactoryBeans. We already provide a base coldspring.beans.factory.FactoryBean class used by the AOP layer, that can be extended, then if you load a bean of that type into the factory, it can return another bean via it's getObject() method. But we are working on extending that support to user defined factories that will allow you to define the 'factory-method' to return a bean o type 'factory-bean'. We still have some big issues to solve with that one, but expect to see it included in the 1.0 release


On Dec 20, 2005, at 12:41 PM, Baz wrote:

 

Hi all,

 

How would you go about giving a CFC the ability to create other CFCs? How would inject the factory itself into a CFC so that methods inside the CFC can create other CFCs? Most of the time I inject ALL required CFCs, but sometimes a CFC should be able to create other CFCs on the fly and not during initial load.

 

Cheers,

Baz

 



Reply via email to