Click here to Skip to main content
13,351,465 members (46,490 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


13 bookmarked
Posted 11 Oct 2013

Design Patterns

, 11 Oct 2013
Rate this:
Please Sign up or sign in to vote.
Design PatternsDesign patterns are recognized solutions to common problems defined originally by the Gang of Four programmers. Design patterns are

Editorial Note

This articles was originally at but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

Design Patterns

Design patterns are recognized solutions to common problems defined originally by the Gang of Four programmers. Design patterns are used throughout the ASP.NET Framework.  The various patterns are commonly divided into several different groups depending on the nature of the design problem they intend to solve.

Creational Patterns

  • Factory - This pattern is used to create concrete class instances without specifying the exact class type.  
  • Abstract Factory - This pattern is used to create concrete class instances without specifying the exact class type. The Abstract Factory Pattern provides a way to encapsulate a group of individual factories that have a common theme.
  • Flyweight - A pattern used to maximize the sharing of objects resulting in reduced memory consumption.
  • Singleton - This pattern insures that only a single instance of a given object can exist.
  • Builder - This pattern separate the construction of a complex object from its representation so that the same construction process can create different representations..

Structural Patterns

  • Adapter - Convert the interface of a class into another interface clients expect. Adapter lets the classes work together that couldn't otherwise because of incompatible interfaces
  • Bridge - Decouples an abstraction from its implementation so that the two can vary independantly.
  • Composite - Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
  • Decorator - Allows an objects behavior to be altered at runtime.
  • Facade - Used to provide a simpler interface into a more complicated portion of code. 
  • Proxy - Provides a Placeholder for another object to control access to it.

Behavioral Patterns

  • Chain of Responsibility - The chain of responsibility pattern is a way of communicating between objects.
  • Command - Encapsulates a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.   
  • Iterator - Provides a way to sequentially access aggregate objects without exposing the structure of the aggregate.
  • Mediator - The mediator pattern encapsulate the interaction between a set of objects.
  • Memento - Allows you to save the state of an object externally from that object.
  • Observer - Allows a single object to notify many dependent objects that its state has changed.
  • State - Allows an object to change its behaviour when its internal state changes.
  • Strategy - Allows multiple algorithms to be used interchangeably at runtime.
  • Visitor - The visitor design pattern enables us to create new operations to be performed on an existing structure.
  • Template Method -  Defines the skeleton of an algorithm then lets subclasses implement the behaviour that can vary.


Antipatterns are misapplied design patterns. Common Antipatterns include:

  • The Blob/God Object - When one class contains all of the methods, operations and logic of your application
  • Re-coupling - building an unnecessary dependency between objects
  • Poltergeists - object whose main purpose in life is to pass messages to another object
  • Sequential Coupling - a class that imposes a particular order on its method calls. 

Other patterns






This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

ASP.NET Community
United States United States
This member doesn't quite have enough reputation to be able to display their biography and homepage.
Group type: Collaborative Group

764 members

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180111.1 | Last Updated 11 Oct 2013
Article Copyright 2013 by ASP.NET Community
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid