Software Design Patterns Flashcards

1
Q

what is a design pattern

A

a reusable design solution to a recurring design problem in a specific design context

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

give the standard form of a design pattern (6)

A

name

structure

intent

motivation

implementation

applicability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what do design patterns allow for

A

reuse of code and experience

shared vocabulary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are the three groups of design patterns

A

behavioural

structural

creational

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

give two behavioural design patterns

A

state

strategy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

give two structural design patterns

A

adaptor

composite

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

give two creational design patterns

A

factory method

singleton

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

describe the strategy design pattern

A

create a set of objects that hold alternate algorithms to solve a problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

describe the composite design pattern

A

common base class represents both part of object and its containing object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

describe the adapter design pattern

A

create a wrapper that converts incoming request into correct format

useful for legacy code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

describe the factory design pattern

A

create a class whose job is to create objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

describe the singleton design pattern

A

create a class whose constructor is called differently and calls to create return instances of the same base class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly