Design Patterns Flashcards

1
Q

Name two Design Patterns

A
Singleton
Builder
Observable
Factory
Strategy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Builder Pattern

A

An object creation pattern. The point is to separate construction of a complex object from its represantation. This means that the construction process can create different representations.

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

Singleton Pattern

A

Ensures that there is only one instance of this class. This class can be accessed globally

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

Factory Pattern

A

Object creation pattern. In this pattern subclasses decide which class to instantiate.

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

Observable Pattern

A

A pattern where there is a relationship between two objects. Subject and Observer/subscriber. Subjects will notify observers/subscribers when state or information has changed.

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

Strategy Pattern

A

A pattern that enables selecting an algorithm at runtime. This is done by passing in a devised “strategy” at initialization.

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