[PEAK] Using config.FactoryFor

John Landahl john at landahl.org
Thu Dec 18 05:38:19 EST 2003


Just started using the new "component factories" feature(s)... this is 
*really* great stuff.

In some cases the standard factory itself is needed (e.g. to be able to 
pass data to the constructor, to be able to create objects on the fly, 
etc.), so it seems that config.FactoryFor() is the right tool for the 
job.  Is this a correct way of making the factory itself a binding?

     myFactory = binding.Make(
         lambda self: importObject(
             self.lookupComponent(config.FactoryFor(ISomeInterface))
         )
     )



More information about the PEAK mailing list