0
0
LLDsystem_design~12 mins

Prototype pattern in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Prototype pattern

The Prototype pattern is a design pattern used to create new objects by copying existing ones, called prototypes. It helps in situations where creating an object from scratch is costly or complex. This system allows cloning objects efficiently to save time and resources.

Architecture Diagram
User
  |
  v
Prototype Manager
  |
  v
Prototype Object(s)
  |
  v
Cloned Object(s)
Components
User
actor
Initiates requests to clone objects
Prototype Manager
service
Stores and manages prototype objects; handles cloning requests
Prototype Object(s)
object
Original objects that serve as templates for cloning
Cloned Object(s)
object
New objects created by copying prototype objects
Request Flow - 4 Hops
UserPrototype Manager
Prototype ManagerPrototype Object(s)
Prototype ManagerCloned Object(s)
Prototype ManagerUser
Failure Scenario
Component Fails:Prototype Manager
Impact:Cloning requests cannot be processed; users cannot obtain cloned objects
Mitigation:Implement redundancy with multiple Prototype Managers or fallback to direct object creation
Architecture Quiz - 3 Questions
Test your understanding
Which component is responsible for managing and cloning prototype objects?
APrototype Manager
BUser
CCloned Object(s)
DPrototype Object(s)
Design Principle
The Prototype pattern demonstrates efficient object creation by cloning existing instances, reducing the cost and complexity of creating new objects from scratch. Managing prototypes centrally allows easy reuse and customization.