The IOC Spring.Net

concept:

          In ASP.NET how Spring dependency injection.

To project a long time ago in my case, there will be realized in the Controller layer injection BLL

 public ISimultProjectBLL  simultProjetBLL { get; set; }
 public IFireSjBLL  fireSjBLL { get; set; }
 public IFireSscBLL  fireSscBLL { get; set; }

Create a configuration file in the Config folder, and configuration information

  <object id = "SimultProjectBLL" type = " full class name, file folder where the name" autowire = "the autodetect" Singleton = "false">
    <Property name = "association class alias" ref = "name of the associated class." />
  </ Object>

MVC request comes --- route matching --- found controller and the Action, in the process in completed simultProjetBLL, fireSjBLL, fireSscBLL initialization (automatically to read congfig configuration, find a specific type depending on the configuration and the associated class)

 

Guess you like

Origin www.cnblogs.com/JohnTang/p/11108672.html