Design Patterns Flashcards

1
Q

Name 5 design patterns? (AABCF)

A
Composite
Adapter
Bridge
Facade
Abstract
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a design pattern?

A

A reusable template for solving a recurring design problem

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

What makes a design modifiable?

A

Low coupling and high cohesion
Clear dependencies
Explicit assumptions

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

How do design patterns help?

A

They are generalised from existing systems
They provide a shared vocabulary to designers
They provide examples of modifiable designs
->Abstract classes
->Delegation

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

Define software system?

A

Consists of subsystems which are either other subsystems or collection of classes

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

Define software lifecycle?

A

Consists of a set of development activities which are either other activities or collections of tasks

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

What is a adapter pattern?

A

Lets classes work together that couldn’t otherwise because of incompatible interfaces.

(English speaker example)

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

What is a bridge pattern?

A

Can be used to provide multiple implementations under the same interface

(Drawing and shapes example)

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

What is a facade pattern?

A

Provides a unified in face to a set of classes in a subsystem

(Messy design)

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

What is a composite pattern?

A

Lets a client treat individual objects and compositions of these objects uniformly

(GUI example)

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

What is a abstract factory pattern?

A

Allows you to create objects without specifying the exact class of object that will be created

(UFO, Rocket, Boss UFO example)

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

Some design patterns use what?

A

Delegation and inheritance

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