Ioc:The basic pattern for integrating Autofac into your application

The basic pattern for integrating Autofac into your application is:

  • Structure your app with inversion of control (IoC) in mind.
  • Add Autofac references.
  • At application startup...
  • Create a ContainerBuilder.
  • Register components.
  • Build the container and store it for later use.
  • During application execution...
  • Create a lifetime scope from the container.
  • Use the lifetime scope to resolve instances of the components.
上一篇:Android 加了自定义Application后报错 Unable to instantiate activity ComponentInfo ClassNotFoundException


下一篇:Android java.lang.RuntimeException: Unable to instantiate activity ComponentInfo 特殊异常