I gave a talk about Dependency Injection on last weekend and It was my first public speaking ever. I want to say thanks to anyone who attended this talk, you guys was my big support, thank you so much. But for lacking of experience my talk was not smooth and did not give you— my listeners enough information about dependency injection as well as Dagger 2 library. So I decided to write this blog to correct my fault.

First of all, I forgot to talk about why Dagger is named as Dagger. Actually it is coming from DAG which stands for directed acyclic graph. So we know Dagger is a directed graph without any cycle. So we cannot create a cycle dependency when using Dagger, it will throw exception in compile time. For example we can not create something like: A dependents to B, B dependents to C, and C dependents to A. It is a cycle dependency, we should avoid it when using Dagger.

Because of time constraint, I could not walk throw how to add Dagger to your project. So I just created a small gist about dagger 2 configuration with comments. You can see it here: Dagger 2 Configuration.

The last thing I want to mention is I have learned a lot of things after the talk. I have better understanding about dependency injection as well as Dagger when I preparing for the talk. So that sharing and talking is one of the best way to learn and hope it is the same for everyone. Thank you again for attending and listening.

Materials of the talk:

Slide

Dagger 2 Example