Design Patterns

 Rate It (27)

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.
  • 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.

Structural Patterns

  • Adapter - Convert the interface of a class into another interface clients expect. Adpater 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 strutures 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

  • Observer
  • State - Allows an object to change it behaviour when its internal state changes.
  • Strategy - Allows multiple algorithms to be used interchangeably at runtime.
  • Visitor

Anitpatterns

Antipatterns are misapplied design patterns. Common Antipatterns include:

  • The Blob - When one class contains all of the methods, operations and logic of you application

Videos

Articles

Books

 

Revision number 22, Tuesday, March 11, 2008 6:08:08 PM by
This is not the most up to date version of this article. The most recent version can be found here.

Comments

The way "Factory" and "Abstract Factory" are explained above. Is there any difference between them. I see same line for both

Related Articles

Proxy

Proxy Design Pattern The Gang Of Four definition of this design pattern is "Provides a surrogate or placeholder for another object to control access to it". In the example below we use the pattern to enable caching on an ASP.net page. This code uses the Factory

MVP Pattern

MVP (Model View Presenter)Framework The MVP pattern is an Architecture Pattern used to build ASP.net applications. It refers to splitting up the responsibilities for gathering, displaying, and storing data from a web page into separate objects: a Model object

Provider Model

Provider ModelThe provider model patternwas designed toprovide a configurable component for data access which isdefined from the web.config. The Provider interfacesbetween the Business logic and Data Access. The actual concrete implementation of the provider

Shortcuts

Table of Contents

Top Wiki Contributors

Advertise Here

Microsoft Communities
Page view counter