Factory method pattern:
The intent of Factory method pattern is to let a class developer define the interface for creating an object while retaining control of which class to instantiate.
Factory method pattern
1. AppLab’s Factory method pattern
You might think that any method that creates and returns a new object is a “factory method”. However, methods that return new objects are common, and not every such method is an Factory method pattern.
The fact that Factory method is an operation that both creates an object and isolates a client from knowing which class to instantiate.In Factory method, you will find several classes that implement the same operation, returning the same abstract type but internally instantiating different classes that implement the type.
Abstract Factory pattern:
The intent of Abstract Factory method pattern is to allow the creation of families of related or dependent objects.
As with Factory method, Abstract Factory isolates client from knowing which class to instantiate. Abstract Factory lets you provide a client with a factory that produces objects that are related by a common theme.