什么是控制反转?当第一次遇到控制反转(或IoC)时,可能会非常混乱。那是什么?它解决了哪些问题?什么时候使用合适,什么时候不合适?
3 回答

波斯汪
TA贡献1811条经验 获得超4个赞
print "enter your name" read name print "enter your address" read address etc... store in database
when the user types in field a, store it in NAME when the user types in field b, store it in ADDRESS when the user clicks the save button, call StoreInDatabase

婷婷同学_
TA贡献1844条经验 获得超8个赞
分开 什么
什么时候
要做的部分 确保 什么时候
部分知道 一点儿
尽可能. 什么
部分;反之亦然。
--
--
事件处理。事件处理程序(要做什么部分)-引发事件(待做部分) 接口。组件客户端(待做部分)-组件接口实现(要做什么部分) xUnit夹具。安装和拆卸(要做什么部分)-xUnit框架在开始时调用安装程序,在结束时调用拆卸(完成时部分) 模板法设计模式模板方法-to-do部件-原始子类实现什么-to-do部件? COM中的DLL容器方法。DllMain,DllCanUnload等(要做什么部分)-com/OS(待办部分)
- 3 回答
- 0 关注
- 1617 浏览
添加回答
举报
0/150
提交
取消