What Is a Design Pattern?
Essay by review • February 23, 2011 • Essay • 1,512 Words (7 Pages) • 1,008 Views
Literature Review
Chapter One
Introduction
What is a Design Pattern?
A design pattern solves a problem within a given context. The solution that is offered by implementing a pattern results in a system design structure, which balances the concerns of the design problem in a manner most appropriate for the given context. In “Understanding and Using Patterns in Software Development”, Dirk Riehle and Heinz Zullighaven offer a rather nice definition of what a design pattern is:
“A pattern is the abstraction from a concrete form which keeps recurring in specific non-arbitrary contexts.”
The ability to write good patterns is very difficult. A pattern should not only convey the facts about a system, but it should also tell a story about the system. It should allow the systems users to comprehend it, be able to customize it to accommodate new features.
Elements of a Design Pattern
A design pattern can be made up of the following components:
Name
The design pattern must have a meaningful name to allow a developer to use a single word or short phrase to reference the pattern.
Problem
The problem describes the patterns intent, the goal and objectives the pattern wants to achieve within the given context.
Context
The context of the pattern is the preconditions under which the problem and its solution seem to recur, and for which the solution is desirable.
Motivation
A description of the relevant forces/constraints and how they can interact/conflict with each other and the goals the pattern wishes to achieve.
Solution
The solution illustrates the structure of the pattern through UML diagrams, textual descriptions that include the patterns collaborations and participants.
Sample Example
One or more sample applications of the pattern which illustrates:
• A specific initial context
• Application of the design pattern
• The resulting context of the application after the pattern is implemented
Resulting Context
This describes the configuration of the system after the design pattern has been applied.
Related Patterns
This describes the interaction with/ from other patterns.
Known Uses
Describes known implementations of the pattern. This helps to validate its use by proving to solve a particular recurring problem.
The goal of this project is to produce a repository of design pattern implementations through a PIM(Personal Information Manager) application, in order to help software developers better understand the use of design patterns. The limitations of current presentations of patterns is addressed by augmenting certain sections from above such as Motivation, Solution, Context and Known Uses. The lack of pattern interaction that is displayed by many examples in today’s literature is also addressed. The primary focus of the project is not so much on the technology used but more on creating a resource that documents and supports developers when approaching new system designs.
Design Patterns
Software development is among the most complex human activities. Software development methodologies, tools, programming languages and practices are continually addressing the complexity at the heart of software structures, devising and revising approaches to improve quality, reusability and productivity.
Design patterns are one such approach in a wider family of methods. This methodology was first introduced over ten years ago. One of the very first publications illustrating the use of patterns in software development was “Design Patterns: Elements of Reusable Object-Orientated Software” published in 1995 by a group of four men Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides who became known as the Gang of Four (GoF):
The difficulty and limitations of this book are that it is now over ten years since it’s publication, which is a long time in the software development industry. The industry has seen new methodologies and practices emerge, such as Test Driven Development, Refactoring for example, which may now enhance the objective that design patterns aimed to achieve and that is to develop reusable, flexible systems.
The patterns described in the GoF book are illustrated in C++; a programming language that has been declining in use over the last number of years, which limits the learning of patterns in today’s development environment where the dominant programming language taught and used, as far as patterns are concerned is Java, although patterns can be implemented in any object orientated programming language.
The patterns exhibited are described in very concise and restricted examples that lack a comprehensive context in order for the reader to gain a full understanding of the use of the pattern in question. The patterns throughout the book are also presented in isolation to each other which hinders the illustration of pattern interaction and thus the full benefit to those wishing to learn how to implement design patterns.
Allen Holub produced a book “Holub on Patterns вЂ" Learning Design Patterns by Looking at Code”, which detailed the use of design patterns while developing a game called “Game of Life. The Game of Life is a cellular automation program, which begins with cells that are classed as either “alive” or “dead”. The idea is then that each cell follows a set of rules to determine which whether it can “live” or whether it must “die”.
Holubs’
...
...