INTRODUCTION TO PATTERNS Flashcards
Design patterns are
typical solutions to commonly occurring
problems in software design. They are like pre-made blueprints that you can customize to solve a recurring design problem in your code.
The
pattern is not a specific piece of code, but a
general concept
for solving a particular problem. You can follow the pattern details and implement a solution that suits the realities of your
own program.
While an algorithm always defines a clear set of actions that
can achieve some goal, a pattern is a
more high-level description of a solution. The code of the same pattern applied to two different programs may be different.
The most basic and low-level patterns are often called
idioms.
They usually apply only to a single programming language.
The most universal and high-level patterns are
architectural
patterns. Developers can implement these patterns in virtually any language. Unlike other patterns, they can be used to
design the architecture of an entire application.
all patterns can be categorized by their intent, or
purpose.
- Creational patterns
- Structural patterns
- Behavioral patterns
The concept of patterns was first described by
Christopher
Alexander in A Pattern Language: Towns, Buildings, Construc-
tion1.Thebookdescribesa“language”fordesigningtheurban
environment. The units of this language are patterns. They
may describe how high windows should be, how many levels
a building should have, how large green areas in a neighbor-
hood are supposed to be, and so on.