タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

ProgrammingとprogrammingとDIに関するteracy_junkのブックマーク (4)

  • 忙しい人の為のDependency Injection(依存性注入)の概念 - Qiita

    はじめに 依存性の注入って稀に良く聞くけど何それよく分からん怖いって人(私)向けに書きました。 DIライブラリの使い方からDIを学ぼうとすると困難だったので、まずはDIとは?についてまとめています。 DIを行う組み立て役の係Assemblerが居ること、依存性という単語ではなく依存オブジェクトと念頭に置いとくと理解しやすいです。 Dependency Injection(依存オブジェクト注入)とは DIとは、Controllerが使用したい依存オブジェクトを第三者オブジェクトが生成/代入する概念のこと。 依存オブジェクトを生成/代入をする第三者オブジェクトAssemblerを導入する必要がある。 前提としてClassの公開済みの振る舞いとしてProtocol/Interface相当で定義する必要がある。 Protocol/Interfaceを使用しないスタイルでコーディングしているならば、

    忙しい人の為のDependency Injection(依存性注入)の概念 - Qiita
  • 作って理解するDIコンテナ - きしだのHatena

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

    作って理解するDIコンテナ - きしだのHatena
  • Dependency Injection With Dagger 2 on Android | Envato Tuts+

    Dependency injection is a software design pattern focused on making our applications loosely coupled, extensible, and maintainable. In this tutorial, you will learn how to handle dependency injection using Dagger 2. Introduction When you have an object that needs or depends on another object to do its work, you have a dependency. Dependencies can be solved by letting the dependent object create th

    Dependency Injection With Dagger 2 on Android | Envato Tuts+
  • Dagger

    Deprecated – Please upgrade to Dagger 2 Square's Dagger 1.x is deprecated in favor of Google's Dagger 2. Please see the migration guide for help with the upgrade. Introduction The best classes in any application are the ones that do stuff: the BarcodeDecoder, the KoopaPhysicsEngine, and the AudioStreamer. These classes have dependencies; perhaps a BarcodeCameraFinder, DefaultPhysicsEngine, and an

  • 1