September 2016
Intermediate to advanced
775 pages
18h 22m
English
In this chapter, we have seen how to use the Prototype design pattern. Prototype is used for creating exact copies of objects. Creating a copy of an object can actually mean two things:
In the first case, we want to focus on improving the performance and the memory usage of our application by introducing data sharing between objects. But we need to be careful about modifying data, because all modifications are visible to all copies. Shallow copies were not introduced in this chapter, but you might want to experiment with them.
In the second case, we want to be able to make modifications to one copy without affecting ...
Read now
Unlock full access