什么是控制反轉?當第一次遇到控制反轉(或IoC)時,可能會非?;靵y。那是什么?它解決了哪些問題?什么時候使用合適,什么時候不合適?
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 關注
- 1668 瀏覽
添加回答
舉報
0/150
提交
取消