This chapter covers the prototype pattern.
GoF Definition
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Concept
In general, creating a new instance from scratch is a costly operation. Using the prototype pattern, you can create new instances by copying or cloning an instance of an existing one. This approach saves both time and money in creating a new instance from scratch.
Real-World Example
Suppose we have a master copy of a valuable document. We need to incorporate some changes to it to see the effect of the ...