Giter Site home page Giter Site logo

@Scope usage about mosby HOT 5 CLOSED

sockeqwe avatar sockeqwe commented on August 24, 2024
@Scope usage

from mosby.

Comments (5)

sockeqwe avatar sockeqwe commented on August 24, 2024

Im not sure what you are talking about. Are you just talking about the dependency declaration:
compile 'javax.annotation:javax.annotation-api:1.2'

or why im using @Singleton instead of defining things like @ActivityScope?

Regarding the second one: I'm just lazy :)

Btw. The mail sample will get a huge dagger2 update.

from mosby.

IgorGanapolsky avatar IgorGanapolsky commented on August 24, 2024

What I am talking about is what Jake Wharton used in his u2020 project for Dagger. You can also see usages of this for Dagger 2 here: https://github.com/LiveTyping/u2020-mvp

from mosby.

IgorGanapolsky avatar IgorGanapolsky commented on August 24, 2024

Does @Singleton replace @ActivityScope?

from mosby.

sockeqwe avatar sockeqwe commented on August 24, 2024

https://github.com/LiveTyping/u2020-mvp/blob/master/app/src/main/java/ru/ltst/u2020mvp/ui/ApplicationScope.java

@Singleton is just an @Scope like @ActivityScope or @ApplicationScope is.
You could say that @Singleton extends Scope and @ActivityScope extends Scope ...

@ActivityScope is defined in the u2020 project, it's nothing already provided by dagger2, while @Singleton is officially part of javax.inject package. As I already said before, I was supper lazy and use @Singleton since there is just one single scope and one component in this demo app.

Overall, this demo is not a Dagger2 demo at all ...

from mosby.

IgorGanapolsky avatar IgorGanapolsky commented on August 24, 2024

I see. I guess I'll stick to your simpler implementations 😄

from mosby.

Related Issues (20)

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.