當你想要一個子objectgraph添加到您的全局對象圖使用:依賴注入:匕首取出子圖
newObjectGraph = objectgraph.plus(new SubModule("SomeConfig"));
現在你與子模塊完成,你想讓它去(或?或許你想與子模塊(「AnotherConfig」)來代替它,你會怎麼做其實,我需要做什麼或者我可以簡單地做:
anotherNewObjectGraph = objectgraph.plus(new SubModule("AnotherConfig"));
PS:這個問題是基於關於Android上的Dagger.1的演示文稿由Jake Wharton提供。
具體的幻燈片將談到這個添加和刪除程序: https://speakerdeck.com/jakewharton/android-apps-with-dagger-devoxx-2013?slide=113