7、At that time they can safely become Guice managed.
11、I've written this article specifically for Guice 2.0, covering some new Guice features and glossing over features from 1.0 that have been deprecated.
15、To keep the work manageable, you can store the Guice Injector somewhere and call it directly.
19、Guice and other DI frameworks serve as flexible "super factories" that you configure to build your objects.
23、不要把提供者與provider方法弄混淆了(在Guice 1.0,這兩者更難區分開來)。
27、如果要了解更多Guice高級功能(比如面向方面編程支持),建議您訪問參考資料中的一些鏈接。
1、Guice: Download the Guice 2 beta release.
5、Guice calls this method immediately after it constructs my hero.
10、Guice傳遞給模塊的Binder 用於告訴Guice您想如何構造對象。
16、If you are using an IOC model already (Guice, Spring etc.) then migrating is usually a lot easier.
21、Louth's analysis reveals that, in some configurations, Spring 2.5 is now faster than Guice, and overall the two frameworks are now much closer in performance.
26、但是,Guice的默認綁定程序api不允許出現“每次調用時將hero類綁定到一個不同的實現”這樣的調用。
2、This code creates a Guice module.
8、The Binder that Guice passes to your module lets you tell Guice how you want your objects constructed.
14、Guice automatically injects the provider method in Listing 15 with the correct arguments.
22、Dhanji:當然可以。主要的原則就是簡潔與類型安全,就像Guice那樣。
29、如果您已經決定使用Guice 1.0,用户指南中有這種舊方法的文檔,而且在本文隨附的示例代碼中,您可以找到一個自定義provider。
6、Finally, Sitebricks is built directly on top of Guice.
17、It turns out that Guice can bind constant values as well as new instances. Check out Listing 21.
25、If you've decided to use Guice 1.0, the user's guide has documentation on the old way, and the sample code supplied with this article has a custom provider you can look at.
4、You rely on Guice to provide your dependencies, even when you're configuring your Guice module itself.
18、如果您熟悉Guice,上述代碼應該會看起來很眼熟。
30、例如,我們可以劃分、合併、*入各種各樣的涉及認*和站點安全的服務,如同處理Guice的servlet模塊一樣簡單。
13、Provider methods are an excellent way to integrate other libraries into your Guice module.
3、Tell Guice which dependency you want.
24、我認為依賴倒置非常重要,因此打算轉換對Guice的依賴。
20、Now that Guice knows that your hero needs a Vehicle, it needs to know which Vehicle to provide.
28、Louth的分析表明,在某些情況下,Spring2.5要快於Guice,從整體來看,二者在*能上已經非常接近了。
12、Familiarity with Guice, or with another dependency injection framework such as Spring, would be useful.
9、I hope you'll consider adding Guice to your toolkit.