0
0
LLDsystem_design~12 mins

Why creational patterns manage object creation in LLD - Architecture Impact

Choose your learning style9 modes available
System Overview - Why creational patterns manage object creation

This system explains why creational design patterns are used to manage object creation in software design. The key goal is to control how objects are created to improve flexibility, reuse, and maintainability of code.

Architecture Diagram
User
  |
  v
Client Code
  |
  v
Creational Pattern Manager
  |
  +--> Object Factory
  |
  +--> Singleton Instance
  |
  +--> Builder
  |
  v
Created Objects
Components
User
actor
Initiates requests that require object creation
Client Code
component
Code that needs objects but delegates creation to patterns
Creational Pattern Manager
service
Central place managing object creation using patterns
Object Factory
service
Creates objects based on input parameters
Singleton Instance
service
Ensures only one instance of a class is created
Builder
service
Constructs complex objects step-by-step
Created Objects
resource
Objects produced by creational patterns for use
Request Flow - 7 Hops
UserClient Code
Client CodeCreational Pattern Manager
Creational Pattern ManagerObject Factory
Creational Pattern ManagerSingleton Instance
Creational Pattern ManagerBuilder
Creational Pattern ManagerClient Code
Client CodeUser
Failure Scenario
Component Fails:Creational Pattern Manager
Impact:Objects cannot be created or managed properly, causing application errors or crashes
Mitigation:Implement fallback default object creation in client code or use error handling to prevent crashes
Architecture Quiz - 3 Questions
Test your understanding
Why does the client code delegate object creation to the Creational Pattern Manager?
ATo avoid using objects altogether
BTo centralize and control how objects are created
CTo speed up user input
DTo bypass object creation
Design Principle
This architecture shows how creational patterns centralize and control object creation to improve code flexibility, reuse, and maintainability by separating creation logic from usage.