[factory-pattern] What are the differences between Abstract Factory and Factory design patterns?

  1. My first question is about the abstract factory. Is its role to allow you to create families of concrete objects in (that can depend on what specific factory you use) rather than just a single concrete object?

Yes. The intent of Abstract Factory is:

Provide an interface for creating families of related or dependent objects without specifying their concrete classes.


  1. Does the abstract factory only return one very large object or many objects depending on what methods you call?

Ideally it should return one object per the method client is invoking.

  1. My understanding is that the factory method pattern has a Creator interface that will make the ConcreteCreator be in charge of knowing which ConcreteProduct to instantiate. Is this what it means by using inheritance to handle object instantiation?

Yes. Factory method uses inheritance.

  1. Abstract Factory pattern delegate the responsibility of object instantiation to another object via composition? What does this mean?

AbstractFactory defines a FactoryMethod and ConcreteFactory is responsible for building a ConcreteProduct. Just follow through the code example in this article.

You can find more details in related SE posts:

What is the basic difference between the Factory and Abstract Factory Patterns?

Design Patterns: Factory vs Factory method vs Abstract Factory

Examples related to factory-pattern

Implement a simple factory pattern with Spring 3 annotations What are the differences between Abstract Factory and Factory design patterns? What is the difference between Builder Design pattern and Factory Design pattern? Dependency Injection vs Factory Pattern Factory Pattern. When to use factory methods?

Examples related to factory-method

What are the differences between Abstract Factory and Factory design patterns? How to implement the factory method pattern in C++ correctly What is the basic difference between the Factory and Abstract Factory Design Patterns? What are static factory methods? What is the difference between Builder Design pattern and Factory Design pattern? Factory Pattern. When to use factory methods?

Examples related to design-patterns

How to implement a simple scenario the OO way Implementing Singleton with an Enum (in Java) What is difference between MVC, MVP & MVVM design pattern in terms of coding c# Best Practices for mapping one object to another REST API Login Pattern When should we use Observer and Observable? How to implement a FSM - Finite State Machine in Java Function in JavaScript that can be called only once Thread Safe C# Singleton Pattern Repository Pattern Step by Step Explanation

Examples related to abstract-factory

What are the differences between Abstract Factory and Factory design patterns? What is the basic difference between the Factory and Abstract Factory Design Patterns?