Chapter 5 - Bend, or Break Flashcards

1
Q

What is coupling?

A

Coupling is the degree of interdependence between software modules; a measure of how closely connected two routines or modules are. We should try to create loosely coupled modules. So, we can have an overall system that is easier to change.

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

What is the principle “Tell, don’t ask”?

A

This principle says the you shouldn’t make decisions based on the internal state of an object and then update that object.

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

What is the problem with Global data?

A

It adds coupling to the application because each piece of global data acts as if every method in your application suddenly gained an additional parameter: after all, that global data is available inside every method.

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

What an event represents?

A

An event represents the availability of information.

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

What is an Finite-State-Machine (FSM)?

A

A state machine is basically just a specification of how to handle events. It consists of a set of states, one of which is the current state. For each state, we list the events that are significant to that state. For each of those events, we define the new current state of the system.

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

What does consist the Observer Pattern?

A

In the observer pattern we have a source of events, called the observable and a list of clients, the observers, who are interested in those events.

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

What is Transforming Programming?

A

It is a way of programming that focuses on transforming an input to an output.

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

What is the problem with Inheritance?

A

Inheritance is coupling. Not only is the child class coupled to the parent, the parent’s parent, and so on, but the code that uses the child is also coupled to all the ancestors.

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

What are some alternatives to Inheritance?

A

1 - Interfaces
2 - Delegation
3 - Mixins and traits

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

When should you use external configuration?

A

When you want to change application paratemers after the app goes live.

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