Ninject Flashcards
What are some of the main advantages of dependency injection?
Helps to automate the injection of mock objects by using common mocking frameworks such as Moq or RhinoMock.
What is dependency injection’s value proposition?
The vast majority of effort that is invested in software development happens after the initial release.
How are ninject bindings used?
Ninject bindings are used to wire up abstract service types to concrete implementations.
How do you tell ninject to use a particular class when it encounters a dependency on an interface?
Bindings are typically expressed via Ninject’s fluent interface:
Bind().To();
What is one advantage of ninject’s fluent interface vs XML mappings, or other injection frameworks?
The fluent interface enables Intellisense and completion.
Describe the constructor injection options that ninject will choose from.
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.
Can Ninject inject dependencies into source code that has not been modified with the [Inject] attribute?
Yes, Ninject can use unaltered source code by looking for constructors it can use.