Factory Pattern
The Factory method pattern defines an interface in terms of contract for creating an object but let’s subclasses decide which classes to instantiate. Factory method lets the class differ instantiation to sub classes. It says that when you are about to instantiate let’s encapsulate that instantiation so that we can make it uniform across all... » read more