Prototype pattern

Prototype pattern

The prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. This pattern is used to avoid subclasses of an object creator in the client application, like the factory method pattern does and to avoid the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword) when it is prohibitively expensive for a given application.

Comment
enThe prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. This pattern is used to avoid subclasses of an object creator in the client application, like the factory method pattern does and to avoid the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword) when it is prohibitively expensive for a given application.
Depiction
Prototype UML.svg
W3sDesign Prototype Design Pattern UML.jpg
DifferentFrom
Function prototype
Prototype-based programming
Has abstract
enThe prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. This pattern is used to avoid subclasses of an object creator in the client application, like the factory method pattern does and to avoid the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword) when it is prohibitively expensive for a given application. To implement the pattern, the client declares an abstract base class that specifies a pure virtual clone method. Any class that needs a "polymorphic constructor" capability derives itself from the abstract base class, and implements the clone operation. The client, instead of writing code that invokes the "new" operator on a hard-coded class name, calls the clone method on the prototype, calls a factory method with a parameter designating the particular concrete derived class desired, or invokes the clone method through some mechanism provided by another design pattern. The mitotic division of a cell — resulting in two identical cells — is an example of a prototype that plays an active role in copying itself and thus, demonstrates the Prototype pattern. When a cell splits, two cells of identical genotype result. In other words, the cell clones itself.
Hypernym
Pattern
Is primary topic of
Prototype pattern
Label
enPrototype pattern
Link from a Wikipage to an external page
w3sdesign.com/%3Fgr=c04&ugr=proble%7Cwebsite=w3sDesign.com%7Caccess-date=2017-08-17
fbb-git.gitlab.io/cppannotations/cppannotations/html/cplusplus14.html%23l318
archive.org/details/designpatternsel00gamm
Link from a Wikipage to another Wikipage
Abstract factory pattern
Base class
Builder pattern
Category:Articles with example Java code
Category:Software design patterns
Class diagram
Composite pattern
Constructor (computer science)
Creational pattern
Decorator pattern
Delegation (programming)
Derived class
Design pattern (computer science)
Design Patterns
Factory method
Factory method pattern
File:Prototype UML.svg
File:W3sDesign Prototype Design Pattern UML.jpg
Function prototype
Inheritance (computer science)
Instance (computer science)
Mitosis
New (C++)
Object (computer science)
Parameter
Polymorphism (computer science)
Prototype
Sequence diagram
Singleton pattern
Software development
Subclass (computer science)
Unified Modeling Language
Virtual method
SameAs
54xmN
m.015yqr
Prototipo (patrón de diseño)
Prototípus programtervezési minta
Prototyp (designmönster)
Prototyp (Entwurfsmuster)
Prototyp (návrhový vzor)
Prototyp (wzorzec projektowy)
Prototype
Prototype
Prototype (padrón de deseño)
Prototype (patron de conception)
Prototype pattern
Prototype pattern
Prototype パターン
Q928696
Прототип (пројектни узорак)
Прототип (шаблон)
Прототип (шаблон проектирования)
Прототип (шаблон проєктування)
Նախատիպ (նախագծման ձևանմուշ)
תבנית Prototype
الگوی نمونه اولیه
原型模式
프로토타입 패턴
Subject
Category:Articles with example Java code
Category:Software design patterns
Thumbnail
W3sDesign Prototype Design Pattern UML.jpg?width=300
WasDerivedFrom
Prototype pattern?oldid=1095343024&ns=0
WikiPageLength
12987
Wikipage page ID
164851
Wikipage revision ID
1095343024
WikiPageUsesTemplate
Template:Cite book
Template:Cite journal
Template:Cite web
Template:Design Patterns Patterns
Template:Distinguish
Template:Multiple issues
Template:Not a typo
Template:Other uses
Template:R
Template:Refimprove
Template:Reflist
Template:Refn
Template:Tone
Template:Wikibooks