Over a million developers have joined DZone.

The Basics of Design Patterns

DZone's Guide to

The Basics of Design Patterns

Free Resource

The Future of Enterprise Integration: Learn how organizations are re-architecting their integration strategy with data-driven app integration for true digital transformation.

What is a Pattern?

A Pattern is a solution to a problem in a context.

Context : is the situation in which the pattern applies.This should be a recurring situation

Problem : refers to the goal you are trying to achieve in this context. But it also refers to any constraints that occur in the context.

Solution : is what you are after: a general design that anyone can apply which resolves the goal and the set of constraints.

This means, a Design Pattern gives you a solution to a common recurring design problem, However,The Design Patterns are not meant to be laws or rules; they are just guidelines that you can even alter to fit to your needs

The first and the most definite Fundamental Design Pattern Catalog is GOF, There are 23 fundamental patterns in it.

Before Start Learning the Design Pattern you need to Knowing the OO basics (Abstraction,Encapsulation, Inheritance, Polymorphism) will
not make you a good designer :) ,Patterns do not give you code. They give general solutions to design problemsPatterns are not invented they are discovered.

To learn patterns faster, they can be classified as,

Creational Patterns: Used to construct objects such that they can be decoupled from their implementing system.

Structural Patterns: Used to form large object structures between many disparate objects.

Behavioral Patterns: Used to manage algorithms, relationships, and responsibilities between objects.

Reference Head First Design Pattern Book

We need to use Design Patterns as a tool, which only be used when it is needed, Otherwise Heavy use of patterns will lead to complexity. Now I thing you have a clear idea about What is Design Pattern ?

Thanks, Have a great day :)

Make your mark on the industry’s leading annual report. Fill out the State of API Integration 2019 Survey and receive $25 to the Cloud Elements store.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}