Saturday, 11 May 2013

Design Pattern

What is a Design Pattern?
A design pattern is a reusable software solution A design pattern is a reusable software solution to a specific type of problem that occurs frequently when developing software. Over the many years of practicing software development, experts have figured out ways of solving similar problems. These solutions have been encapsulated into design patterns. So:
  • patterns are proven solutions to software development problems •
  • patterns are scalable as they usually are structured and have rules that you should follow
  • patterns are reusable for similar problems
A pattern is initially presented in the form of a rule that establishes a relationship between:
  • A context
  • A system of forces that arises in that context and
  • A configuration that allows these forces to resolve themselves in context
With this in mind, let’s now take a look at a summary of the component elements for a design pattern. A design pattern should have a:
  • Pattern name and a description
  • Context outline – the contexts in which the pattern is effective in responding to the user’s needs.
  • Problem statement – a statement of the problem being addressed so we can understand the intent of the pattern.
  • Solution – a description of how the user’s problem is being solved in an understandable list of steps and perceptions.
  • Design – a description of the pattern’s design and in particular, the user’s behavior in interacting with it
  • Implementation – a guide to how the pattern would be implemented
  • Illustrations – a visual representation of classes in the pattern (e.g. a diagram))
  • Examples – an implementation of the pattern in a minimal form
  • Co-requisites – what other patterns may be needed to support use of the pattern being described?
  • Relations – what patterns does this pattern resemble? Does it closely mimic any others?
  • Known usage – is the pattern being used in the wild? If so, where and how?
  • Discussions – the team or author’s thoughts on the exciting benefits of the pattern