Inversion of Control

本想看看 .Net 實做 Spring專案的.找著找著,又看到了 Castle. 後來發現他們都用了所謂的 Inversion of Control 的概念.
這我就好奇了,甚麼是 Inversion of Control ??
這裡看到一段很好的解說:

“That’s the basic concept of Inversion of Control; you don’t create your objects, you describe how they should be created. You don’t directly connect your components and services together in code, you describe which services are needed by which components, and the container is responsible for hooking it all together. The container creates all the objects, wires them together by setting the necessary properties, and determines when methods are invoked.”

然後提到大致上有三種實做的方式:

type-3 Services dependencies are provided as constructor parameters (and are not exposed as JavaBeans properties). This is the exclusive approach used by PicoContainer, and is also used in HiveMind and Spring.

接著又提到 Inversion of Control Container 應該被稱為 Dependency Injection pattern 會比較恰當…看這篇:Inversion of Control Containers and the Dependency Injection pattern
PicoContainerCastle 很接近,應該都屬於 type-3 – constructor injection, 此外也有很重的 Interface Injection 味道.
上面那篇文章寫的很好,可以算是經典文了.
其他參考性的東西,不再贅述…
*Castle 官網上對 IoC 的說明就直接貼出兩篇經典文的網址.
*c# 對 IoC 的實做,目前有三個實做: StructureMap, Castle, Spring.net
*Open Source Inversion of Control Containers in C#
*Design Better Software with the Inversion of Control Pattern
*Inversion of Control
*PicoContainer – Inversion of Control
*Apache Excalibur – guide-patterns-ioc

本性解碼

愛麗絲夢遊部落格仙境: 本性解碼逛到的,既逛之,則玩之.
我的結果大致是這樣:

雙子 50%
天蠍 20%
獅子 10%
牡羊 20%
整體性格
elleryq先生,靈活變通;溫柔體貼;開朗隨和;禮貌周到;努力向上也享受生活。
待人性格
elleryq先生待人:合情合理;重視感情;既喜歡與人同樂也能樂於獨處;有自信但不愛出風頭;有親疏觀念但不過分;大方坦蕩但也能保守秘密。
處世性格
elleryq先生處事:善於表達意見但不愛管閒事;隨和有彈性;行事圓融;把握重點兼顧細節;比較理想化;既有計劃也靈活應變。
性格缺點
elleryq先生性格的缺點為:容易產生忌妒心;有時候缺乏享受浪漫的心情;偶爾會動作緩慢老是慢半拍。
價值觀
elleryq先生重視的價值觀為:愛情的滋潤;和諧的人際關係;勢力範圍;較不擅長:與眾不同;追逐功利;出頭爭先。
愛情性格
elleryq先生在愛情上喜歡快速的進展步調,很羅曼蒂克,享受獨立也喜歡有人作伴;較常表現:幽默風趣,情深意濃,認真執著,優雅大方。
金錢性格
elleryq先生的金錢觀:花錢有分寸不浪費也不小氣,喜歡按照計劃用錢;容易把錢用於:追求新奇,享受浪漫,紓解壓力,崇尚唯美。

還可以看五星運勢,不過那是算當天的,就不貼了…
要直接算的話,點這裡吧…