Prototype


Usage

  • A fully initialized instance to be copied or cloned
  • Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype

Diagram

Prototype

Participants

Prototype
  • Declares an interace for cloning itself
ConcretePrototype
  • Implements an operation for cloning itself
Client
  • Creates a new object by asking a prototype to clone itself

Resources URL: 
notes/design_patterns/resources
Sources URL: 
notes/design_patterns/sources

See Also