2.1 Factory

The factory design pattern is one of the most basic and foundational patterns. The goal of the factory pattern is to provide a mechanism to create objects, with a dynamic creation process that is able to determine which type of object to create at runtime.