This question already has an answer here:
There are two main differences between the design patterns Factory Method and Abstract Factory.
Difference 1 is that Factory Method is mainly based on inheritance. A class in a way uses it's subclass to create objects. The objects created depend on the subclass used. While Abstract Factory is based on inheritance but in a way also on composition - A client 'owns' an Abstract Factory instance to hold a concrete factory.
Difference 2 is that Factory Method creates one object, while Abstract Factory creates a family of related objects.
Difference 1 I understand (although I'm having trouble understanding why anyone would prefer to subclass a class that needs a factory instead of just 'giving' it a factory using composition [unless that class already has a subclass]).
But difference 2 I don't understand.
Why can't Factory Method create a family of products instead of one product? It can certainly return an array of products of the same family. All of these products share a common interface - the method can return an array of that type. Why is it said that this method only produces one product?
Additionally, a factory method inside a concrete subclass of an abstract factory creates different products using different methods that are called by the client.
Why can't a concrete factory in the Factory Method pattern do the same? Have different factory methods for different products?