December 2018
Intermediate to advanced
512 pages
8h 51m
English
This chapter covers the prototype pattern.
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
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.
Suppose we have a master copy of a valuable document. We need to incorporate some changes to it to see the effect of the ...