Design patterns Flashcards

1
Q

What is a design pattern

A

A design pattern describes a problem that occurs over and over again in our environment and then describes the core solution to the problem in a way that you can use this solution without doing it the same way twice

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

what are some examples of software engineering patterns

A
Observer
Façade 
Iterator
Decorator 
Adapter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does an observer deign pattern handle

A

If we are soring data and we want to an easy way to update all of the displays when the data changes

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

Why would you use an observer pattern

A

Easy to build, Good for standardisation

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

What is a façade design pattern used for

A

Used when describing a standard way of grouping together similar interfaces into a class

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

What is iterator design pattern used for

A

It provides a common design for algorithms which operate on a collection of items

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

When will you typically come across iterator patterns

A

Processing lists or sets

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

When are adaptor design patterns used

A

Translates the interface of one class into that of another

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

What to variants do adapter designs come in

A

Object or class

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

What is the decorator pattern used for

A

Used to extend the functionality of an class or object

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

What do decorator patterns allow for

A

Run time alternative to sub classing

Responsibilities to be added to or removed from an object at run time

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