Please enable Javascript to correctly display the contents on Dot Net Tricks!

Gang of Four (GOF) Design Patterns in .Net

  Author : Shailendra Chauhan
Posted On : 25 May 2013
Total Views : 69,630   
Updated On : 24 Feb 2017
 

In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides published a book (Design Patterns: Elements of Reusable Object-Oriented Software) for explaining the concept of Design Pattern in Software development. These four authors are collectively known as Gang of Four (GOF).

GOF Design Patterns

The 23 Design patterns are defined by the Gang of Four programmers. These 23 patterns are divided into three groups depending on the nature of the design problem they intend to solve.

  1. Creational Design Patterns

    These patterns deal with the process of objects creation in such a way that they can be decoupled from their implementing system. This provides more flexibility in deciding which objects need to be created for a given use case/ scenario. There are as follows:

    1. Factory Method : Create instances of derived classes

    2. Abstract Factory : Create instances of several classes belonging to different families

    3. Builder : Separates an object construction from its representation

    4. Prototype : Create a duplicate object or clone of the object

    5. Singleton : Ensures that a class can has only one instance

  2. Structural Design Patterns

    These patterns deal with the composition of objects structures. The concept of inheritance is used to compose interfaces and define various ways to compose objects for obtaining new functionalities. There are as follows:

    1. Adapter : Match interfaces of different classes

    2. Bridge : Separates an object’s abstraction from its implementation

    3. Composite : A tree structure of simple and composite objects

    4. Decorator : Add responsibilities to objects dynamically

    5. Façade : A single class that represents an entire complex system

    6. Flyweight : Minimize memory usage by sharing as much data as possible with similar objects

    7. Proxy : Provides a surrogate object, which references to other object

  3. Behavioral Design Patterns

    These patterns deal with the process of communication, managing relationships, and responsibilities between objects. There are as follows:

    1. Chain of Responsibility: Passes a request among a list or chain of objects.

    2. Command: Wraps a request under an object as a command and passed to invoker object.

    3. Interpreter: This pattern involves implementing an expression interface which tells to interpret a particular context.

    4. Iterator: It provides a way to access the elements of a collection object in sequential manner without knowing its underlying structure.

    5. Mediator: It allows multiple objects to communicate with each other’s without knowing each other’s structure.

    6. Memento: It used to capture the current state of an object and store it in such a manner that it can be restored at a later time without breaking the rules of encapsulation.

    7. Observer: It used when there is one to many relationship between objects such as if one object is modified.

    8. State: It used when there is one to many relationship between objects such as if one object is modified, its dependent objects are to be notified automatically.

    9. Strategy: It allows a client to choose an algorithm from a family of algorithms at run-time and gives it a simple way to access it.

    10. Visitor: It used to create and perform new operations onto a set of objects without changing the object structure or classes.

    11. Template Method: It used to define the basic steps of an algorithm and allow the implementation of the individual steps to be changed.

What do you think?
I hope you will enjoy the GOF design patterns while designing your software. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.


Free Interview Books
 
COMMENTS (0)
9 MAR
ASP.NET MVC with Angular2 Development (Online)

09:00 PM - 11:00 PM IST( TUS, THR, SAT)

Know More
6 MAR
Master Class Fast Track MVC 5 with Angular2 Development (Online)

10:30 AM -03:30 PM IST (Fast Track)

Know More
6 MAR
Angular 2 Master Class Fast Track Online Development Training (Online)

10:30 AM- 01:30 PM IST

Know More
27 FEB
ASP.NET MVC with Angular2 Development (Online)

07:00 AM - 09:00 AM IST( MON, WED, FRI)

Know More
25 FEB
ASP.NET MVC with Angular2 Development (Classroom)

05:00 PM-06:30 PM

Know More
25 FEB
Xamarin Forms : Build Cross-platform Apps (Classroom)

8:00 AM-9:30 AM

Know More
25 FEB
ASP.NET MVC with Angular2 Development (Classroom)

3:00 PM-4:30 PM

Know More
14 FEB
.NET Development (Classroom)

11:00 AM-12:00 PM

31 JAN
ASP.NET MVC with Angular2 Development (Online)

07:00 AM-09:00 AM IST(Tuesday & Thursday)

30 JAN
NODEJS & MEAN Stack 2.x Development (Online)

09:00 PM-11:00 PM IST( MON, WED, FRI)

15 JAN
PPC Marketing (Classroom)

04:00 PM-05:30 PM

10 JAN
ASP.NET MVC with AngularJS Development (Online)

09:00 PM-11:00 PM IST on (TUE, THRU,SAT)

31 DEC
ASP.NET MVC with AngularJS Development (Classroom)

09:30 AM-11:00 AM

5 NOV
ASP.NET MVC with AngularJS Development (Classroom)

08:00 AM-09:30 AM

BROWSE BY CATEGORY
 
 
LIKE US ON FACEBOOK
 

Professional Speaks

+