Static Class Structure
Client
ProductA and
ProductB objects.
AbstractFactory interface
to create ProductA and
ProductB objects
and is independent of
how the objects are created
(which concrete classes are instantiated).
factory)
to an AbstractFactory
object.
AbstractFactory
Factory1,…
AbstractFactory interface
by creating and returning the objects.
Dynamic Object Collaboration
Client object
delegates creating product objects
to a Factory1 object.
Client is configured with a
Factory1 object.
Client
that calls createProductA() on
the installed Factory1 object.
Factory1 creates a
ProductA1 object
and returns (a reference to)
it to the Client.
Client
calls createProductB()
on Factory1.
Factory1
creates a ProductB1 object
and returns it to the Client.
Client
can then use
the ProductA1 and ProductB1
objects as required.