The prototype pattern is very simple in concept. It describes a way for an object to make a copy of itself. In other words, we start with one object (prototype) and end with two indistinguishable copies.
Note
We don't have to look far to find a real-life example of the prototype pattern. Life, as we know it, is based on cellular division, a process in which one cell divides into two identical copies of itself.
Every implementation of this pattern is very specific to the target environment. In Delphi, we can implement a prototype pattern by creating a new object and copying old contents to the new instance in some way. Creating a new object is simple, but copying data may not be. In this section, we'll mostly deal with the copy mechanism.
By implementing the prototype pattern (or cloning, as we also call this process), we bypass object initialization, which may be a lengthy operation. Sometimes, we even don't have access to the original data from which the object was initialized and...