Function:
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
Participants:
AbstractFactory (ContinentFactory)
ConcreteFactory (AfricaFactory, AmericaFactory)
AbstractProduct (Herbivore, Carnivore)
Product (Wildebeest, Lion, Bison, Wolf)
Client (AnimalWorld)
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
Participants:
- declares an interface for operations that create abstract products
- implements the operations to create concrete product objects
- declares an interface for a type of product object
- defines a product object to be created by the corresponding concrete factory
- implements the AbstractProduct interface
- uses interfaces declared by AbstractFactory and AbstractProduct classes
浙公网安备 33010602011771号