Results 1 - 4 of 4 results out of about 720 pages. (0.25 seconds)
- guice/Manual/UserGuide/Motivation . . . 16 matches
- ...いから!
== 直接コンストラクタ呼び出し ==
クレジットカードプロセッサとトランザクションロガーを今書いたとしよう。
{{{
public class RealBillingService implements BillingService {
public Receipt chargeOrder(PizzaOrder order, Credi...
- guice/Manual/UserGuide/GettingStarted . . . 8 matches
- ...ラフを作れるように構成しておかなくてはいけない。
我々は、CreditCardProcessorとTransactionLogをコンストラクタ引数として受け取るRealBillingServiceクラスを例としてあげた。
RealBillingServiceのコンストラクタがGuiceによって起動されるように、@Injectアノテーションをつけた。
{{...
- guice/Manual/UserGuide/Bindings/BindingAnnotations . . . 4 matches
- ...のである(訳注:必ずこれが必要)
アノテーションバインディングに依存させるには、注入されるパラメータにアノテーションを適用する。
public class RealBillingService implements BillingService {
{{{
@Inject
public RealBillingService(@PayPal Cr...
- guice/Manual/UserGuide/InjectingProviders . . . 3 matches
- ...= プロバイダをインジェクトする =
通常の依存性注入では、各タイプはただ一つのインスタンスを受け取る。
つまり、RealBillingServiceには一つのCreditCardProcessorと一つのTransactionLogである。
しかし、よりフレキシビリティが必要な場合にはGuiceはプロバイダをバインドする。
プロバイダはそのget()メソ...