7
從我的理解IServiceLocator是一個接口來抽象實際的IoC容器?我在詢問與Prism有關的信息,我試圖使用replace Unity with Prism,並且我看到依賴於IServiceLocator的Prism類。有人可以澄清接口的作用以及接口的使用時間嗎?什麼是IServiceLocator接口?
而且;什麼是Common Service Locator,這對IServiceLocator的使用會有幫助嗎?
THX!好答案。雖然找不到Ninject的IServiceLocator適配器,但它可能不被認爲是主要的? (ref *(每個主要的IoC容器提供了這樣的適配器)*) – stiank81 2010-04-12 17:46:06
參見http://github.com/enkari/ninject/tree/2.0.0.0/src/CommonServiceLocator.NinjectAdapter/ – 2010-04-12 18:14:52
Cool-thx。我自己雖然已經寫了同樣的東西.. – stiank81 2010-04-12 19:18:39