IOC & DI
IOC的优点
when using DI / IoC Container, we may replace SomeService with SomeTestService on registration side, without needing to change anything on the consuming
side.
使用容器中的对象的方式:Resolve(显示用Resolvecoin从容器中拿) 或 DI(构造函数注入).
注册单例
container.Register<IA,A>(Reuse.Singleton);