Pages

Saturday, March 3, 2012

Design Pattern Implementation using C#

Introduction

Design patterns may be said as a set of probable solutions for a particular problem which is tested to work best in certain situations. In other words, Design patterns, say you have found a problem. Certainly, with the evolution of software industry, most of the others might have faced the same problem once. Design pattern shows you the best possible way to solve the recurring problem.

Uses of Design Patterns

While creating an application, we think a lot on how the software will behave in the long run. It is very hard to predict how the architecture will work for the application when the actual application is implemented completely. There might issues which you cant predict and may come while implementing the software. Design patterns helps you to find tested proven design paradigm to build a solid foundation for your project. So, if you follow design pattern you can easily prevent major issues to come while building your actual project. Moreover design pattern also helps the other architects to understand your code easily.

History of Design Patterns

When the word design pattern comes into mind, the first thing that one may think is the classical book on Design Pattern "Gangs of Four" which was published by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides.  In this book, it is first discussed capabilities and pitfalls of Object oriented programming, and later on it discusses about the classic Design Patterns on OOPS.

You can read more about history of design patterns from here.

Types of Design Pattern

Design patterns can be divided into 3 categories.

Creational Patterns : These patterns deals mainly with creation of objects and classes.
Structural Patterns : These patterns deals with Class and Object Composition.
Behavioural Patterns : These mainly deals with Class - Object communication. That means they are concerned with the communication between class and objects.

In this article, I am going to discuss few examples of these patterns. They are
Singleton Design Pattern
Factory Design Pattern
Factory Method Design Pattern
Abstract Factory Design Pattern,
Builder Design Pattern,
Prototype Design Pattern
Adapter Design Pattern
Bridge Design Pattern
Decorator Design Pattern
Composite Design Pattern
Flyweight Design Pattern
Memento Design Pattern
Mediator Design Pattern
Observer Design Pattern
Iterator Pattern

No comments: