Factory design pattern
4 min readDec 1, 2022
Factory design pattern in Python programming
There are several design patterns that are commonly used in Python programming. Some of the most common design patterns include:
- Singleton: This design pattern ensures that a class has only one instance, and provides a global point of access to it.
- Factory: This design pattern provides a way to create objects without specifying the exact class of object that will be created.
- Adapter: This design pattern allows classes with incompatible interfaces to work together by wrapping the original class and providing a new interface.
- Decorator: This design pattern allows new functionality to be added to an existing object without modifying its structure.
- Observer: This design pattern allows objects to observe and react to changes in other objects.
- Strategy: This design pattern allows the behavior of an algorithm to be changed at runtime.
- Template: This design pattern defines the skeleton of an algorithm, allowing subclasses to provide specific implementation details.
- Command: This design pattern allows you to encapsulate a request as an object, separating the request from the object that executes it.