Tuesday, 6 March 2007

Introduction to Patterns

What is Pattern?

Pattern is a form, template or a model that can be used to solve recurring problems. Pattern helps to give the solution of problems of similar nature that has happened in the past and have the possibility of occurring again in the future. It saves time and effort on problem solving by keeping the records of a problem’s solution so that it can be implemented again.

History

Christopher Alexander originated patterns during 1977/79 as an architectural concept. He built patterns for solving recurring problems he faced during constructions. In 1987, Kent Beck and Ward Cunningham began experimenting with the idea of applying patterns to programming and presented their results at the OOPSLA conference that year. In the following years, Beck, Cunningham and others followed on this work. [1]

Pattern & Software

People have done the obvious thing:

• Develop patterns that are a prescription of how to solve particular problems that come up in development

• Knuth


What do pattern languages provide?

• common vocabulary

• common base of understanding what’s important in programming

• a large corpus of solutions makes developers more effective

Here is an example of a pattern that I have found out in the real world.

Problem Name:

Find the products that you want in a superstore without any hassle

Context:

Most of us have come across the problem of finding the right product when we go to shop in a superstore. As a result, shopping takes longer than it should take. Although the superstores in UK have a banner on top of each aisle saying what it contains, one has to go through each and every aisle and the information on top of them to find the thing that is wanted. Moreover, information that is given for each aisle is a pain to go through as it is placed very high on the shop floor and some shoppers find it difficult to get what they want

Solution:
An information board should be kept at the entrance of each superstore with a detailed description of what the aisles in the shop contain. This would save time and energy of the shoppers as they can straight go to the aisles from where they need to pick up staffs.

References:
1. http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29 (accessed on 5th of March 2007)