The Basics of Design Patterns
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.
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.
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 :)
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)