Factory design pattern

Soumendra's Blog
4 min readDec 1, 2022
Factory design pattern in Python programming

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:

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

--

--