0
0
LLDsystem_design~12 mins

When to use which creational pattern in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - When to use which creational pattern

This system helps developers decide which creational design pattern to use based on their software creation needs. It guides through common scenarios like object creation complexity, reuse, and flexibility requirements.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
Decision Service
  |
  +-----------------------------+
  |                             |
  v                             v
Factory Pattern Module      Singleton Pattern Module
  |                             |
  v                             v
Prototype Pattern Module    Builder Pattern Module
  |
  v
Response Module
  |
  v
User
Components
User
actor
Developer or system requesting pattern recommendation
Load Balancer
load_balancer
Distributes incoming requests evenly to API Gateway instances
API Gateway
api_gateway
Handles client requests and routes them to the Decision Service
Decision Service
service
Analyzes input criteria and selects the appropriate creational pattern
Factory Pattern Module
service_module
Provides logic and examples for Factory pattern usage
Singleton Pattern Module
service_module
Provides logic and examples for Singleton pattern usage
Prototype Pattern Module
service_module
Provides logic and examples for Prototype pattern usage
Builder Pattern Module
service_module
Provides logic and examples for Builder pattern usage
Response Module
service_module
Formats and sends the pattern recommendation back to the user
Request Flow - 9 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayDecision Service
Decision ServiceFactory Pattern Module
Decision ServiceSingleton Pattern Module
Decision ServicePrototype Pattern Module
Decision ServiceBuilder Pattern Module
Decision ServiceResponse Module
Response ModuleUser
Failure Scenario
Component Fails:Decision Service
Impact:Pattern recommendation cannot be made; user receives error or no response
Mitigation:Use service replication and health checks to failover to a healthy instance; cache last successful recommendations for fallback
Architecture Quiz - 3 Questions
Test your understanding
Which component decides which creational pattern to recommend?
ADecision Service
BLoad Balancer
CAPI Gateway
DResponse Module
Design Principle
This architecture demonstrates modular decision-making by separating pattern evaluation into dedicated modules. It uses load balancing and API gateway to ensure scalability and manageability. The system isolates concerns, making it easier to maintain and extend with new patterns.