Design Patterns Flashcards

1
Q

What is the point of a dependency injection pattern?

A

Allows for class variable configuration when an a class object is created. This allows for greater class flexibility as you can create different objects of a class with different class variable values and allows for different unit test scenarios.

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

What is the point of the Options pattern?

A

Turns groups of related configuration settings into a class representation. This allows for encapsulation and separation of concerns as the settings are easily to modify due to the loose coupling and the whatever is trying to access the configuration settings only sees the settings that it requires.

When using the options pattern, an options class:
Must be non-abstract with a public parameterless constructor
Contain public read-write properties to bind (fields are not bound)

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

What is a software pattern?

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