Coder Social home page Coder Social logo

mobile-android2's Introduction

Dependency Injection in Kotlin

Dependency Injection in build upon the concept of Inversion of Control. Which says that a class should get its dependencies from outside.In simple words, no class should instantiate another class but should get the instances from a configuration class.

The most important advantage is that it increases the possibility of reusing the class and to be able to test them independent of other classes.

Mode of injections & Order

  1. Constrctory
  2. Field
  3. Method

Dagger Gradle Dependecies

    implementation 'com.google.dagger:dagger-android:2.23.2'
    kapt 'com.google.dagger:dagger-android-processor:2.23.2'
    kapt 'com.google.dagger:dagger-compiler:2.25.3'
    implementation "com.google.dagger:dagger:2.25.3"
    
    Note: Dont forge to add 
    
    apply plugin: 'kotlin-kapt'

mobile-android2's People

Contributors

abhishek08 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.