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
Videos
Articles
Books
Revision number 21, Tuesday, March 11, 2008 7:12:47 AM by
This is not the most up to date version of this article. The most recent version can be found here.
You must Login to comment.
|
Tue, Aug 5, 2008 3:02 AM
by shailatlas
|
The way "Factory" and "Abstract Factory" are explained above. Is there any difference between them. I see same line for both
|
|
Fri, Sep 26, 2008 6:36 AM
by uniquesaiful
|
Difference between the two is that with the Abstract Factory pattern, a class delegates the responsibility of object instantiation to another object via composition whereas the Factory Method pattern uses inheritance and relies on a subclass to handle the desired object instantiation.
|
|
Sun, Oct 12, 2008 5:16 PM
by PaulSpencer
|
the abstract factory pattern Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
whereas the factory pattern Defines an interface for creating an object, but let subclasses decide which class to instantiate. Factory method lets a class defer instantiation to subclasses.
|
Revision #3
Wed, Mar 5, 2008 7:56 AM
by
|
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
|
Revision #4
Wed, Jun 11, 2008 8:33 PM
by
|
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
|
Revision #7
Thu, Nov 13, 2008 10:51 PM
by
|
Singleton
Singleton The Singleton Design Pattern ensures that only a single instance of a given object can exist. It does this by making the class constructorprivate so that it [the singleton itself]has full controlover when the class instance is created. In order to
|