Design: Prototype Pattern Implementation
Focus on the design and implementation of the prototype pattern in a software system. Out of scope are UI details, persistence layers, and distributed system concerns.
Functional Requirements
FR1: Allow creation of new objects by copying existing ones (cloning).
FR2: Support deep and shallow copy options.
FR3: Enable customization of cloned objects without affecting the original.
FR4: Provide a registry to manage prototypes for easy access and cloning.
FR5: Ensure cloning is efficient to improve performance when creating many similar objects.
Non-Functional Requirements
NFR1: Cloning operations should have low latency (p99 < 50ms).
NFR2: Support up to 10,000 clone requests per minute.
NFR3: Maintain consistency so cloned objects do not share mutable state unintentionally.
NFR4: Design should be extensible to add new prototype types without major changes.