Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prototype Pattern 1.

Similar presentations


Presentation on theme: "Prototype Pattern 1."— Presentation transcript:

1 Prototype Pattern 1

2 Definition Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype

3 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

4 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

5 ?

6 References Dofactory – “Prototype”


Download ppt "Prototype Pattern 1."

Similar presentations


Ads by Google