[PEAK] "Component Factories" suggestion

Radek Kanovsky rk at dat.cz
Fri Dec 17 10:43:15 EST 2004


Hi Phillip,

I would welcome small change in config.CreateViaFactory implementation.
What I exactly want to do is to specify factory function in "Component
Factories" section. This factory should look up some config data and
create instance of some class. Class of returned instance can vary
according to configuration. It is not possible now, because factory
doesn't receive any context:

    instance = factory()
    binding.suggestParentComponent(serviceArea, None, instance)

Suggested implementation:

    instance = factory(serviceArea, None)

or:
    instance = binding.IComponentFactory(factory)(serviceArea, None)

RadekK



More information about the PEAK mailing list