Giter Site home page Giter Site logo

Comments (17)

cgruber avatar cgruber commented on July 23, 2024 2

Dagger 2.0 has been released, and the names are, for @component Foo you get
DaggerFoo, and for @component Bar.Blah (nested) you get DaggerBar_Blah as
the implementation types for components.

On Mon, 13 Apr 2015 at 10:41 TJ (Thomas J.) Biddle [email protected]
wrote:

@cgruber https://github.com/cgruber Also - quick clarification. This
will also fix the issue regarding the prefixes having changed from the
2.0-SNAPSHOT? They used to be Dagger_xxxx And now it's just Daggerxxxx from
what I'm hearing

β€”
Reply to this email directly or view it on GitHub
#58 (comment).

from dagger.

gk5885 avatar gk5885 commented on July 23, 2024

Yeah, that needs to be fixed. We are actually tracking a bug internally for this.

from dagger.

codefromthecrypt avatar codefromthecrypt commented on July 23, 2024

+1 on the AutoValue style naming convention.

from dagger.

gk5885 avatar gk5885 commented on July 23, 2024

Hey, while we're all chatting about it…

Dagger_MyComponent or DaggerMyComponent (or something else)

MyClass$$Factory or MyClass_Factory or MyClass__Factory (or something else)

from dagger.

codefromthecrypt avatar codefromthecrypt commented on July 23, 2024

I'm pretty in favor of underscores. At slight checkstyle risk for the
overzealous, it avoids confusion about regular $ use.

from dagger.

JakeWharton avatar JakeWharton commented on July 23, 2024

For generated code that needs to be explicitly referenced, I definitely prefer underscores. For generated code that's not referenced directly I'd leave it or keep it relatively clear that it's generated.

from dagger.

cgruber avatar cgruber commented on July 23, 2024

I actually prefer underscores even for generated unreferenced code because
eclipse has serious problems with $. Given that all generated code is
viewable, people will step into code that will erroneously show errors.
Underscores seem to not invoke this bad editor behavior.

On Sat, Nov 8, 2014, 04:20 Jake Wharton [email protected] wrote:

For generated code that needs to be explicitly referenced, I definitely
prefer underscores. For generated code that's not referenced directly I'd
leave it or keep it relatively clear that it's generated.

β€”
Reply to this email directly or view it on GitHub
#58 (comment).

from dagger.

JakeWharton avatar JakeWharton commented on July 23, 2024

Kotlin has problems with $ as well. Kill kill kill it.

from dagger.

Ch3D avatar Ch3D commented on July 23, 2024

+1
This issue stops me from migration to Kotlin

from dagger.

Lakedaemon avatar Lakedaemon commented on July 23, 2024

+1
I'm a kotlin developer. This issues stops me from migrating to dagger. :)

from dagger.

artem-zinnatullin avatar artem-zinnatullin commented on July 23, 2024

I am using Dagger 2 with Kotlin without any problems:

Components and Modules in Java, injecting like this (Android):

public class App extends Application {

    private DIGraph mDIGraph;

    /**
     * Returns application object from context
     * @param context to get application object
     * @return application object
     */
    public static App get(Context context) {
        return (App) context.getApplicationContext();
    }

    @Override public void onCreate() {
        super.onCreate();

        mDIGraph = Dagger_DIGraph.builder()
                // creating modules
                .build();
    }

    @NonNull public DIGraph getDIGraph() {
        return mDIGraph;
    }
}
class SomeFragment : Fragment {

    var someVar: SomeType? = null
        [Inject] set

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        App.get(getActivity()).getDIGraph().inject(this)

        // we can work with injected someVar
    }
}

from dagger.

mboudraa avatar mboudraa commented on July 23, 2024

+1

from dagger.

asm0dey avatar asm0dey commented on July 23, 2024

πŸ‘

from dagger.

steindekker avatar steindekker commented on July 23, 2024

+1

from dagger.

leomindez avatar leomindez commented on July 23, 2024

+1

from dagger.

cgruber avatar cgruber commented on July 23, 2024

Dagger does Dagger_OuterClass_Foo for components. It will ultimately reject $$ for generated types, but this may not happen in time for 2.0. I'm marking this as a 2.1 issue.

from dagger.

cgruber avatar cgruber commented on July 23, 2024

Fixed in #150

from dagger.

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.