Design Patterns and Principles Flashcards
“Design is not just how it
looks and feels like.
Design is how it works”
What is Design?
● According to Steve Jobs , Cofounder
of Apple:
- is the creation of an experience.
- It’s also the process of the said creation and how well it’s
organized. - On top of that, design is the result , i.e. the things we see,
hear, and feel. - is a plan for arranging elements in such a way as
best to accomplish a particular purpose
Design
- are typical solutions to
commonly occurring problems in software
design. - They are like pre made blue prints that you
can customize to solve a recurring design
problem in your code.
Design patterns
The pattern is not a specific piece of code,
but a __ __ for solving a
particular problem.
general concept
Design patterns are often confused with
algorithms because they both describe
typical solutions (True or false)
True
While an algorithm always defines a clear
set of actions that can achieve some goal, a
pattern is a more ____ of a
solution.
high level description
● Algorithm is a __ , where each
step is required to achieve a goal.
● Design pattern is a ___ , where the
results are visible, but the implementation is
up to you.
cooking recipe, blueprint
sections that are usually present in a
pattern description:
Intent
Motivation
Structure
Code Example
briefly describes both the problem and
the solution.
Intent
shows each part of the pattern and how
they are related.
Structure
Some pattern catalogs list other useful
details, such as:
applicability of the
pattern, implementation steps and
relations with other patterns
further explains the problem and the solution the
pattern makes possible.
Motivation
one of the popular programming languages
makes it easier to grasp the idea behind the pattern.
Code example
The most basic and low level patterns are
often called ___ . They usually apply only to
a single programming language.
idioms
The most universal and high level patterns are_____. Developers can
implement these patterns in virtual ly any
language.
architectural patterns
Pattern Description 3 main groups
Creational patterns
Structural patterns
Behavioral patterns
provide object creation mechanisms that
increase flexibility and reuse of existing code.
Creational patterns provide
explain how to assemble objects and class es into
larger structures, while keeping the structures flexible and efficient.
Structural patterns
take care of effective communication and the
assignment of responsibilities between objects.
Behavioral patterns
are typical solutions to common problems in object
oriented design.
Patterns
The concept of patterns was first described by __ in A Pattern Language:
Towns, Buildings, Construction
Christopher Alexander
The book describes a “ for designing
the urban environment . The units of this
language are patterns.
A Pattern Language:
Towns, Buildings, Construction
The idea was picked up by four authors:
Erich
Gamma, John Vlissides Ralph Johnson, and
Richard Helm
In 1995, they pub lished Design Patterns: Elements of Reusable Object Oriented Software in which they applied the concept of design patterns to programming.
Erich
Gamma, John Vlissides Ralph Johnson, and
Richard Helm
The book featured 23 patterns solving various
problems of object oriented design and became
a best seller very quickly.
Design Patterns: Elements
of Reusable Object Oriented Software
Due to its lengthy name, people started to call it
“the book by the gang of four” which was soon shortened to simply “___”
the GOF book
Since then, dozens of other object
oriented patterns have been
discovered. The “___”
became very popular in other
programming fields, so lots of other
patterns now exist outside of object
oriented design as well.
pattern approach
are a toolkit of tried and tested solutions to
common problems in software design.
Design patterns
define a common language that you and your
teammates can use to communicate more efficiently.
Design patterns