控制反转
摘要:
IoC就是IoC(Inversion of Control),不是什么技术,与GoF一样,是一种设计模式。InterfaceDrivenDesign接口驱动,接口驱动有很多好处,可以提供不同灵活的子类实现,增加代码稳定和健壮性等等,但是接口一定是需要实现的,也就是如下语句迟早要执行:AInterfacea=newAInterfaceImp();这样一来,耦合关系就产生了,如:class A { AInterface a; A() { } aMethod(){ a = new AInterfaceImp(); }}ClassA与AInterfaceImp就... 阅读全文
posted @ 2013-12-23 11:03 SherryIsMe 阅读(152) 评论(0) 推荐(0)
浙公网安备 33010602011771号