This package defines marker interfaces for factories and factory managers.
Although the interfaces contain no API, by implementing them it denotes
their intended implementation.
Definitions
-
Factory: a factory is used to create objects.
-
Factory Manager: a factory manager "manages" instances of factories
based upon a context (class). There is also a "default" factory
that a factory manager will return if using a context that is not
defined.
The reasons for defining these marker interfaces follows:
-
Factories: factories do not create the same type of object, nor do
they use the same data to construct said objects. For instance, one
factory may require a Bar to create a Foo whereas another factory
may require nothing to create a Zeta.
-
Factory managers: factory managers do not manage the same type of
factory.
It can be argued that FactoryMgrIfc
contain methods to return
FactoryIfc
. However, ideally, one will typically not operate
upon an implementation of FactoryMgrIfc
generically because,
once a FactoryIfc
is retrieved one will still be required to
know the exact subclassed interface. As mentioned above, not all factories
create objects in the same fashion. Therefore there is no generic way to
request a factory create an object.
@see org.jplate.util.factorycontext