Prototype Design Pattern

Prototype Design Pattern

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.


Introduction

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


Benefits

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. 

 

Return to Top


Examples of the pattern

 

Return to Top


See Also

Link to domain parent articles and related articles in TechNet Wiki.

 

Return to Top


Community Resources

These are the external links, including links to Microsoft and TechNet sites that are non-Wiki
  • [Please contribute]

 

Return to Top


References section

Use this section if you pulled source material and ideas from other sites, blogs, or forums. Make sure you have permission from authors to use their material.
  • [Please contribute]

 

 

Return to Top


Leave a Comment
  • Please add 7 and 3 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • 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

Page 1 of 1 (4 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • XAML guy edited Original. Comment: tidied sections

  • XAML guy edited Revision 1. Comment: added

  • XAML guy edited Revision 2. Comment: added example

  • XAML guy edited Revision 3. Comment: counter

Page 1 of 1 (4 items)