There are APIs for creating objects and discovering factories.
createObject(__factory_name, *args, **kwargs)¶
Create an object using a factory
Finds the named factory in the current site and calls it with the given arguments. If a matching factory cannot be found raises
ComponentLookupError. Returns the created object.
A context keyword argument can be provided to cause the factory to be looked up in a location other than the current site. (Of course, this means that it is impossible to pass a keyword argument named “context” to the factory.
Get interfaces implemented by a factory
Finds the factory of the given name that is nearest to the context, and returns the interface or interface tuple that object instances created by the named factory will implement.
Return a tuple (name, factory) of registered factories that create objects which implement the given interface.
zope.component.factory includes some supporting objects.