Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why @Provided instead of @Assisted? #215

Open
lukesandberg opened this issue Mar 31, 2015 · 0 comments
Open

Why @Provided instead of @Assisted? #215

lukesandberg opened this issue Mar 31, 2015 · 0 comments
Labels
Component: factory P3 type=documentation Documentation that is other than for an API

Comments

@lukesandberg
Copy link
Contributor

This isn't really a bug as much as a design question. as far as i am aware @autofactory was designed as a more performant alternative to guices assisted-inject extension, so i am curious why in @autofactory you annotate all the parameters that you want to be injected whereas in guice you annotate all the parameters that should be explicitly passed (with @assisted).

I have a (mild) preference for the @assisted approach since

  1. in my experience, there are are fewer @assisted params than @provided params
  2. the provided params will often already have @qualifier annotations applied to them, so adding @provided adds more noise to the parameter declaration (plus raises unfortunate questions about annotation ordering)
@raghsriniv raghsriniv added the P3 label Jun 24, 2019
@kluever kluever added the type=documentation Documentation that is other than for an API label Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: factory P3 type=documentation Documentation that is other than for an API
Projects
None yet
Development

No branches or pull requests

4 participants