Object Oriented Design Patterns

Gang of Four: In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides published a book titled: Design Patterns – Elements of Reusable Object Oriented Software.

What are Design Patterns?

They are a collection of easily identified and re-usable solutions to commonly occurring development problems faced by developers. One should keep in mind that a Design Pattern is not a complete solution, it only provides a general approach which can be used to design a particular solution.

Design Patterns can be thought of a template where a developer/designer can fit in code (object-oriented) to solve common problems.

Why are Design Patterns important?

To put it in simple words, Design Patterns make our life easier.

The biggest benefit of knowing and using Design Patterns is having a common vocabulary to talk about when discussing solutions. If you know how to implement a Design Pattern, let’s say Singleton Pattern, you basically know a solution before you start implementing.

It also makes the code more readable and maintainable. Several developers can modify/implement different programs in multiple ways. To have a standardized solution definitely saves time, requires less coding. Also, the solutions provided by Design Patterns are sound and reliable as they have been tested many times.

Word of caution:

Do not cram many design patterns in your code just because you know them. Try to find the optimal one, and not the only ones which you know/remember.

There can be different implementation of the same Design Pattern, so it might require analysis, knowledge and experience to decide when to use Design Patterns.

Overview

There are more than 50 identified Design Patterns. I will try to cover the most popular and important ones, and update the remaining Design Patterns later.


Definitely Santanu Baruah. A long way to go.

回复

要查看或添加评论,请登录

Rahul Srivastava的更多文章

  • Adapter Pattern (Structural Pattern)

    Adapter Pattern (Structural Pattern)

    The design patterns which allow the interface of a class to be used as another interface. This is used to adapt and…

  • Singleton Pattern (Creational Pattern)

    Singleton Pattern (Creational Pattern)

    Singleton Pattern: It is a type of Creational Pattern. When we need to make sure that one (and only one) instance of a…

  • Overview of Design Patterns

    Overview of Design Patterns

    There are more than 50 identified Design Patterns. There are 4 main categories of Design Patterns: Creational…

社区洞察

其他会员也浏览了