This article describes the Prototype design pattern. This is a creational design pattern, a category of design pattern used by software engineers, when writing computer programs.
The Prototype pattern is a design pattern, used in software engineering to enable replication of an object. A prototypical instance of the object is initially created. This base/abstract class is able to clone itself. In this pattern, a Client (eg Font Manager) requests a ConcretePrototype (Font) from the Prototype (FontPrototype). This pattern is defined as a Creational design pattern because it relates to the creating of classes that are decoupled from the implementing system (they can create themselves without the requesting code having to know how to instantiate it.
↑ Return to Top
Instead of all the hassle of creating a new instance of the object, cloning is often preferred, to avoid the cost of creating new objects. Because the clone creates a copy of itself, the implementing code doesn't need to know HOW to create it. It is also used to avoid subclassing.
XAML guy edited Revision 3. Comment: counter
XAML guy edited Revision 2. Comment: added example
XAML guy edited Revision 1. Comment: added
XAML guy edited Original. Comment: tidied sections