Design Pattern: Factory Pattern
Factory pattern is one of the most popular and commonly used patterns. When we don’t know what is the type of object that is going to be generated then we use the Factory pattern to create objects based on some criteria.