Prototype

E173607

Prototype is a creational design pattern that enables cloning existing objects to create new instances instead of instantiating classes directly.

All labels observed (2)

Label Occurrences
Prototype canonical 1
Prototype (design pattern) 1

How this entity was disambiguated

Statements (48)

Predicate Object
instanceOf creational design pattern
software design pattern
applicableWhen classes to instantiate are specified at runtime
object creation is expensive or complex
system should be independent of how its products are created
avoids hard-coding concrete class names in client code
subclass proliferation
belongsTo Design Patterns: Elements of Reusable Object-Oriented Software
surface form: Gang of Four design patterns
benefit encapsulates knowledge about which classes to instantiate
reduces number of subclasses needed
simplifies dynamic configuration of products
commonLanguage C#
C++
Java
JavaScript
consequence may complicate handling of deep versus shallow copies
may require careful management of object references during cloning
requires implementing cloning for each prototype
definedIn Design Patterns: Elements of Reusable Object-Oriented Software
definesRole Client
ConcretePrototype
Prototype interface
hasCategory creational pattern
hasIntent create new objects by copying a prototype
specify the kinds of objects to create using a prototypical instance
oftenImplementedWith clone method
copy constructor
serialization-based copying
originatedBy Erich Gamma
John Vlissides
Ralph Johnson NERFINISHED
Richard Helm
patternType object-creation pattern
relatedTo Abstract Factory
Builder
Factory Method
Singleton
requires ability to copy or clone objects
supports adding and removing products at runtime
object cloning
runtime object configuration
typicalOperation clone
usedFor avoiding direct instantiation of classes
cloning existing objects
configuring objects dynamically at runtime
creating new object instances by copying existing ones
decoupling client code from concrete classes
reducing the cost of creating complex objects

How these facts were elicited

Referenced by (2)

Full triples — surface form annotated when it differs from this entity's canonical label.

Memento relatedTo Prototype
subject surface form: Memento (design pattern)
this entity surface form: Prototype (design pattern)