Inversion of Control Flashcards

1
Q

What is inversion of control?

A

Having an external framework manage the flow of control in your program and have your code plug into this call back function idea.

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

What is dependency inject a form of?

A

A form of inversion control

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

What are dependency injections?

A

Stating the dependencies of a class from outside rather than created within the class itself. Separate out the concerns of construction and use of objects. (single responsibility code)

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

What is the dependency injection technique/pattern?

A

Pattern whereby an object can ‘request’ instances of objects it depends upon.
Your code specifies which abstract/virtual classes it wants filled by objects by an injector. In other words you say which interfaces you want concrete implementations of and the injector will provide you with an instance.

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

What rules does the inject hold?

A

The rules for each instance:
- How it should hand out instances of interfaces
- Responsible for which concrete classes should be used for each interface.
- Responsible for instantiation.

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

What do dependency injections allow us to do?

A

Allows us to separate our concerns so objects do not manage their own lifecycle.

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