Google Guice with Android

Googleの DI frameworkであるGuiceを Androidで使う話

Androidとは言っても、特殊な話はあまりなくてAOPの無いGuice

脱WordPress時に掘り起こされたコンテンツなので恥ずかしい限りですが、 そのうち書き直すつもりなので恥を晒しておきます……。

  1. Hello Guice!Androidアプリの作成
  2. Bindings: 注入する物を定義する
  3. Field Injection: FieldにAnnotationをつけてInject
  4. Method Injection: MethodにAnnotationをつけてInjectする
  5. Scope: オブジェクトの再利用・Singleton
  6. Stage: Injectionタイミングの制御
  7. Constructor Injection: ConstructorにAnnotationをつけてInjectする
  8. Provides: 実装クラスのインスタンスを提供する関数を定義する
  9. Binding Annotation: 特別な場合に対応する。