What is a Pattern ?
General Definition
An arrangement of repeated or corresponding parts it could also be referred to as a plan or diagram used to guide in making something using a standard way .
(Collins English dictionary )
Design Patterns Or Software Patterns
Evolution of Design Patterns
Alexander Christopher was a well know town planner who developed construction and building patterns Alexander noticed certain building problems that occurred repeatedly in various building and studied the problematic elements to derive solutions .The solution for each of the identified problem would have a guide or a template of how to solve it though the end results of the use of the solution on different problems would vary .
The Gang of four adapted the principles used by Alexander to solve the construction problems using templates and guides to solve problems in object oriented design .The solutions in solving object oriented designs unlike construction is based on objects ,classes and interface relationships and collaboration .The relationship of classes ,objects and interfaces enables software developers to solve specific problems .
What is a Design Pattern ?
The following are definitions from different website that explain what patterns are .
3 Definitions of A Pattern
PatternIn software development, a
pattern (or design pattern) is a written document that describes a general solution to a design problem that recurs repeatedly in many projects. Software designers adapt the
pattern solution to their specific project.
Patterns use a formal approach to describing a design problem, its proposed solution, and any other factors that might affect the problem or the solution. A successful
pattern should have established itself as leading to a good solution in three previous projects or situations.
In
object-oriented programming, a pattern can contain the description of certain objects and object
classes to be used, along with their attributes and dependencies, and the general approach to how to solve the problem. Often, programmers can use more than one
pattern to address a specific problem. A collection of patterns is called a pattern framework.
(
Reference : http://whatis.techtarget.com/definition/0,,sid9_gci214606,00.html)
Pattern
Describes characteristics
Of a recurring problem
And a successful solution
Provides a template to implement the solution
Simple, elegant, reusable, extensible solutions
Patterns define the interaction between objects
Extensible: “No code before its time” Bill J 1996
(Reference: http://www.dotnetcolumbiasc.org/files/Patterns_101.pps)
A "Pattern" is ...
· An abstraction from a concrete form which keeps recurring in specific, non-arbitrary contexts. [generic definition]
· A recurring solution to a common problem in a given context and system of forces. [Alexander]
· A named "nugget" of instructive insight, conveying the essence of a proven solution to a recurring problem in a given context amidst competing concerns.
· A successfully recurring "best practice" that has proven itself in the "trenches".
· A literary format for capturing the wisdom and experience of expert designers, and communicating it to novices .
(
Reference : http://www.cmcrossroads.com/bradapp/docs/patterns-nutshell.html#Patterns_What)
Conclusive Pattern Definition
A Pattern describes a family of solutions to a software design problem . It consists of one or more software design elements such as modules ,interfaces ,classes ,objects ,methods ,functions ,processes ,thread relationships among the elements and behavioural description . A
pattern will describe how best to solve a problem and provide the consequences it produces or results obtained .
Four Main Elements in a Pattern
The following are descriptions of the four most important elements that make up a pattern and how I understood them.
Pattern Name: The name of a pattern should facilitate ease of communicating solutions between software developers as it would be standard . Pattern names enable good documentation of software solutions .
Problem: This is a description of the situation or problem that needs to be solved in a particular context. The problem that’s occurring will help determine where and how to apply a particular pattern to solve the problem.
Solution: The solution is an organised template, which might consist ,classes ,objects
,interfaces and their relationships . The solution does not solve the problem completely but gives the developer an outline to follow and the rest of the required coding or amendments are
done by the programmer .
Consequences: These are the results or the outcome of applying a pattern to solving a problem. The consequences should be considered an important element as they identify the effectiveness of a pattern in solving a problem .It can give rise to considering in cooperating other related patterns to produce a better result for solving a problem.