Castle Windsor IoC in an MVC application

后端 未结 2 1707
半阙折子戏
半阙折子戏 2020-12-07 15:06

Prepare for a wall of code... It\'s a long read, but it\'s as verbose as I can get.

In response to Still lost on Repositories and Decoupling, ASP.NET MVC

I <

2条回答
  •  广开言路
    2020-12-07 15:59

    Avoid using a static IoC class like this. By doing this you're using the container as a service locator, so you won't achieve the full decoupling of inversion of control. See this article for further explanations about this.

    Also check out Sharp Architecture, which has best practices for ASP.NET MVC, NHibernate and Windsor.

    If you have doubts about the lifecycle of the container itself, see Usage of IoC Containers; specifically Windsor

提交回复
热议问题