title: Why use Dagger with Android Architecture Components
body: <p>I've been missing around one year in Android development and boy, what a large chunk to chew: Kotlin, LifeCycle, Room, ViewModel, Dagger and so on.</p>
  
  <p>I am trying to get my head around the new MVVM recommended pattern and while it's really great to see something more "standardized" there are some things unclear. </p>
  
  <p>To have things in a simple way, let's have a brief sample.</p>
  
  <p>First, create the Entity</p>
  
  <pre><code>@Entity(tableName = "user_table")
  public class User {
  
     @PrimaryKey
     @NonNull
     @ColumnInfo(name = "name")
     //vars, getters, setters
  }
  </code></pre>
  
  <p>Then create the DAO</p>
  
  <pre><code>@Dao
  public interface UserDao {
  
     @Insert
     void insert(User user);
  ...
  }
  </code></pre>
  
  <p>Then, I need to make the Repository. This is basically where my questions start.</p>
  
  <p>I see many examples, on official docs also using Dagger2. While I still struggle to fight with Dagger to proper understand dependency injection my question is, why do I need to use Dagger? I do understand that decoupling components allows easier testing, but is this necessarily for small projects? Why not interact between ViewModel, Repository, DAO directly without injection (maybe having classes passed on constructors)?</p>
  
  <p>As a side note, probably it's a good point to start with Kotlin. While I find it pretty cool I see that many parts of the official docs/guides still only have Java samples... So I kind of want to learn the new stuff with old Java but in the same time, since my previous projects was on javascript, the switch to kotlin wouldn't be that hard...</p>