Friday 31 January 2014

What Is a Design Pattern?


  • Christopher Alexander says, "Each pattern describes a problem which occurs over and over again in our environment , and then describes the core of the solution to that problem, in such way that you can use this solution a million times over, without ever doing it the same way twice".
  • Advantage of design pattern is Re-usability of solutions.
  • a pattern has four essential elements.
  1. Pattern name
  2. Problem
  3. Solution
  4. Consequences

Pattern name-It is a unique name which describes a design problem.It improves communication among developers.
Problem-It states the problem ,how to represent algorithms as objects.It ensures when the pattern is applicable and what conditions should be met before the pattern is used.
Solution-It provides description of elements that make design pattern such as their responsibilities, relationships and collaborations.Pattern solution can't describe a particular implementation because patterns are like  template that are applicable to several similar situations.
Consequences-Highlight the results,pros and cons of applying the pattern.It describes the impacts on system portability, extensibility .