タグ

diに関するbobbyjam99のブックマーク (6)

  • DIコンテナのインジェクション方法の使い分けについて - 日々常々

    DIコンテナを使う時にどのインジェクションを使うかって話です。 たぶん誰かがどこかで同じようなことを書いているだろうけれど、気にせず書くよ。 「他の誰かが書いている」なんてのを書かない理由にしてると何も書けなくなるし。 コンテナ DIコンテナのこと。 コンテナ管理 インスタンスのライフサイクルをコンテナが管理していること。雑に言えば、使う側で new しないってこと。 インジェクション Dependency Injectionのこと。 Short Answer コンストラクタインジェクションを使いましょう。使い分けなくていいです。 3種類のインジェクション インジェクションには3種類ありますね。他あっても知らない。 フィールドインジェクション セッターインジェクション コンストラクタインジェクション フィールドインジェクション 一番よく見るかな。 class Hoge { @Inject

    DIコンテナのインジェクション方法の使い分けについて - 日々常々
  • 作って理解するDIコンテナ - きしだのHatena

    DIコンテナ使ってるけど、アノテーションってなんなの!って聞かれて、作ってみたらわかるよと答えてみたので、自分でも作ってみました。 よくわかった。 「DIコンテナ使うと何がいいの?」ということも、作ってみるとわかります。あと「DIって何がいいの?」に関しては、「DIはちょっとコードを書くのが楽になるだけで、それだけあっても仕方ない、大事なのはコンテナ」と答えるようにしてますが、コード比率からもそれがよくわかります。 続編としてWebフレームワークも作っているので参考まで。 作って理解するWebフレームワーク - きしだのHatena まずはコンテナを作る とりあえず1ソースの状態で。 こんな感じで、管理する型を登録できるようにします。 static Map<String, Class> types = new HashMap<>(); static void register(String

    作って理解するDIコンテナ - きしだのHatena
  • Dagger

    Dagger is a fully static, compile-time dependency injection framework for Java, Kotlin, and Android. It is an adaptation of an earlier version created by Square and now maintained by Google. The latest Dagger release is: Dagger 2.51.1 Dagger aims to address many of the development and performance issues that have plagued reflection-based solutions. More details can be found in this talk (slides) b

  • FlexのDIコンテナ比較 - よねのはてな

    FxUG@北陸でFlexのDIコンテナ徹底比較というお題で発表してきました。 FlexのDIコンテナ比較の資料を公開します、今回は自分自身かなり勉強になったのでとても良かったと思います。 Flex's DI Container 調査したのは以下の3つ。詳しくは資料を見て下さい。 Prana Framework(SpringActionscript) http://www.pranaframework.org/ http://www.springsource.org/extensions/se-springactionscript-as SmartyPants IOC http://code.google.com/p/smartypants-ioc/ swizframework http://code.google.com/p/swizframework/ Flex with maven2

    FlexのDIコンテナ比較 - よねのはてな
  • Jonas Bonér » Blog Archive » Real-World Scala: Dependency Injection (DI)

    Update: Corrected typo in the Cake Pattern version of the last example. Update: Added a version of the last example using the Cake Pattern for easier comparison (see end of post). In this second post in the Real-World Scala series I am going to discuss how to implement/achieve Depenency Injection (DI) in Scala. Scala is a very rich and deep language that gives you several ways of doing DI solely

  • Ajax in Action

    News April 08, 2024 08 Apr'24 Worlds toughest core Java interview question The trickiest Java interview question ever asked? In five words or less, explain the red 'x' the Eclipse IDE displays at the end of the provided Java code snippet. March 04, 2024 04 Mar'24 Best crash course to learn Jenkins from scratch Need to learn Jenkins CI fast? This Jenkins tutorial will quickly get you up to speed on

  • 1