Prototype Pattern 1
Definition Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype
Prototype p = prototype.Clone Class Diagram Client Prototype prototype Operation() Clone() ConcretePrototype1 ConcretePrototype2 Prototype p = prototype.Clone Clone() Clone() // return copy of this // return copy of this
Participants Prototype ConcretePrototype Client declares an interface for cloning itself ConcretePrototype implements an operation for cloning itself Client creates a new object by asking a prototype to clone itself
?
References Dofactory – “Prototype” http://www.dofactory.com/net/prototype-design-pattern