レベルエンター山本大のブログ

面白いプログラミング教育を若い人たちに

BLOCKVROCKリファレンス目次はこちら

2007-03-18から1日間の記事一覧

[翻訳]Guice User's Guide ■13. Annotating Bindings

注釈によるバインディングIf you need multiple bindings to the same type, you can differentiate the bindings with annotations. For example, to bind an interface Service and annotation @Blue to the concrete implementation BlueService, call:複…

[翻訳]Guice User's Guide ■12. DRY (Don't Repeat Yourself)

DRY (自分で書いたものを繰り返すな!)Repeating "binder" over and over for each binding can get a little tedious. Guice provides a Module support class named AbstractModule which implicitly gives you access to Binder's methods. For example…

[翻訳]Guice User's Guide ■11. Binding Dependencies

依存性のバインディングHow does Guice know what to inject? For starters, a Key composed of a type and an optional annotation uniquely identifies a dependency. Guice refers to the mapping between a key and an implementation as a Binding. An …

[翻訳]Guice User's Guide ■10. Bootstrapping Your Application

独力で動くアプリケーションThe idea of bootstrapping is fundamental to dependency injection. Always explicitly asking the Injector for dependencies would be using Guice as a service locator, not a dependency injection framework.「独力で動く…

Guice User's Guide ■15. Annotations With Attributes

属性つきのアノテーションIf you can get by with marker annotations alone, feel free to skip to the next section.もし、あなたがマーカーアノテーションだけでやっていくことができるなら、遠慮なく次のセクションまでスキップしてください。You can al…

[翻訳]Guice User's Guide ■14. Creating Binding Annotations

バインディング用のアノテーションを作るWhere did this @Blue annotation just mentioned come from? You can create such an annotation easily, although the standard incantation you have to use is unfortunately a little complex:先ほど話題に出た…