Factory Pattern

The Factory Pattern is a creational design pattern that provides an interface for creating objects, but allows subclasses to decide which class to instantiate.

It promotes loose coupling by abstracting the instantiation process. This pattern is useful when there is a need to create multiple objects of similar types and encapsulate their creation logic.

By using the Factory Pattern, objects can be created without exposing the instantiation logic to the client code. It helps in writing code that is flexible, maintainable, and easier to extend in the future.