🧠 Second Brain

Search

Search IconIcon to open search

Factory Pattern

Last updated Feb 16, 2025

Factory Pattern Definition:

In software design, the “factory pattern” allows you to create a class, with its subclasses deciding which class to instantiate. Factory patterns allow the creation of objects without specifying the exact class of object that will be created, promoting loose coupling and scalability in code. This pattern is often implemented using a factory method or a factory class to produce instances of objects based on input criteria or conditions. The Factory Pattern is known as a “creational design pattern” (explained  later in this article). Source

More on Factory Method.


Origin: Factory Pattern in Python
References:
Created 2025-02-02