You are assigned to implement a complex object creation scenario where the object’s construction process should be separate from its representation. Which design pattern would you use?
- Decorator Pattern
- Factory Pattern
- Prototype Pattern
- Singleton Pattern
The Factory Pattern is used to create objects with a separation between the construction process and the representation. Factories encapsulate object creation, making it easier to change or extend object creation logic.
Loading...
Related Quiz
- In Python, which loop is used to iterate over a sequence of elements?
- To concatenate two tuples, you can use the ____ operator.
- When using the unittest framework, which method is executed before each test method is run?
- The _______ decorator in a class is used to turn a method into a class-specific method.
- To iterate over a list and its indices simultaneously, you can use the ____ function.