Template Method Design Pattern

Template Method Design Pattern

This article describes the Template Method design pattern. This is a behavioral design pattern, a category of design pattern used by software engineers, when writing computer programs.

Introduction

The Template Method pattern is a design pattern, used in software engineering to define the general structure of an object. For example a class is created with just a set of abstract methods and properties, which define the general theme and use of the class. later, concrete classes are implemented which change the abstract methods into actual operations.


It is defined as a behavioral design pattern, because it is the definition of the methods that a class will use to perform it's actions.

Return to Top


Benefits

It allows a class to control or expose parts of it's behavior, which allows greater extensibility.
It allows a developer to expose suggested "forward thinking" for the class as well as immediate usefulness.

Return to Top


Examples of the pattern

In C# & VB.net, overriding methods is an example of the Template Method.

 

 

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 8 and 4 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 2. Comment: tweak

  • XAML guy edited Revision 1. Comment: tidied sections

  • XAML guy edited Original. Comment: spelling

Page 1 of 1 (3 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: spelling

  • XAML guy edited Revision 1. Comment: tidied sections

  • XAML guy edited Revision 2. Comment: tweak

  • Expected some basic details

Page 1 of 1 (4 items)