07 Dec 2023



Intermediate
FeatureAbstract FactoryFactory Method
IntentCreate families of related or dependent objects without specifying their concrete classes.Define an interface for creating an object, leaving the choice of its type to the subclasses.
ScopeCreates families of related objects.Creates a single object, allowing subclasses to alter the type of objects created.
Number of Classes InvolvedInvolves multiple classes: Abstract Factory, Concrete Factory, Abstract Product, Concrete Product.Typically involves two classes: Creator (Abstract Creator) and Concrete Creator.
Creation MechanismCreates multiple related objects, often organized into families or themes.Creates a single object, but the specific type is determined by subclasses.
ParticipantsAbstract Factory, Concrete Factory, Abstract Product, Concrete Product.Creator (Abstract Creator), Concrete Creator, Product, Concrete Product.
Client InteractionClients use the Abstract Factory interface to create families of objects.Clients use the Factory Method to create a single object without specifying its class.
software-design-patterns
abstract-factory-design-pattern
factory-design-pattern
difference