The Prototype Pattern
is defined in Design Patterns
, Creational catagory. From Design Patterns
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this instance.
This pattern consists of a set of Prototype objects, each of which defines a clone method to reproduce itself. The Prototype objects can all be instances of a single class or a tree of subclasses with a common base class.
This pattern is useful for systems where the classes used are dynamically loaded or determined at runtime. It can help reduce the total number of classes in a system by avoiding a set of factories that mirrors the class hierarchy of products.