Ninject Flashcards

0
Q

What are some of the main advantages of dependency injection?

A

Helps to automate the injection of mock objects by using common mocking frameworks such as Moq or RhinoMock.

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

What is dependency injection’s value proposition?

A

The vast majority of effort that is invested in software development happens after the initial release.

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

How are ninject bindings used?

A

Ninject bindings are used to wire up abstract service types to concrete implementations.

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

How do you tell ninject to use a particular class when it encounters a dependency on an interface?

A

Bindings are typically expressed via Ninject’s fluent interface:
Bind().To();

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

What is one advantage of ninject’s fluent interface vs XML mappings, or other injection frameworks?

A

The fluent interface enables Intellisense and completion.

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

Describe the constructor injection options that ninject will choose from.

A

1) It will look for a constructor with the [Inject] attribute first.
2) It will select the constructor with the most parameters that ninject can resolve.
3) It will select the parameterless constructor if there is one.

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

Can Ninject inject dependencies into source code that has not been modified with the [Inject] attribute?

A

Yes, Ninject can use unaltered source code by looking for constructors it can use.

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