Tuesday 15 June 2010

c# - Determining when to use Dependency Injection -



c# - Determining when to use Dependency Injection -

looking @ lot of mvc source code, notice mvc projects (especially larger projects) implement dependency injection in 1 way or another.

i have 2 questions. first of all, feasible create big project without using dependency injection? understand dependency injection makes big projects lot easier maintain , unit test. how much more complex project didn't utilize dependency injection?

second, when scoping requirements of new project, criteria should utilize determine if should utilize dependency injection? requires lot of initial setup , seems unnecessary quick simple program.

there no such thing wrong or useless dependency injection recommend utilize :)

it makes code much more extensible, easier test , more readable (because dependencies visible).

second, when scoping requirements of new project, criteria should utilize determine if should utilize dependency injection?

you can avoid prototyping or if building not used in production environment.

it feasible create big project without using dependency injection?

yes not recommend this

it requires lot of initial setup , seems unnecessary quick simple program.

asp.mvc has built in back upwards dependency injection. can setup pretty quickly. matter of nuget bundle instalation.

c# asp.net-mvc dependency-injection

No comments:

Post a Comment