PROTOTYPE Pattern
Context
- A system instantiates objects of classes that are not known when
the system is built.
- You do not want to require a separate class for each kind of
object.
- You want to avoid a separate hierarchy of classes whose
responsibility it is to create the objects.
Solution
- Define a prototype interface type that is common to all created
objects.
- Supply a prototype object for each kind of object that the system
creates.
- Clone the prototype object whenever a new object of the given
kind is required.