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

Introduce specialized annotations for scoped injectors #60

Merged
merged 11 commits into from
Sep 26, 2022

Conversation

kingsleyadio
Copy link
Contributor

@kingsleyadio kingsleyadio commented Sep 22, 2022

Currently, we use ContributesInjector for all cases where we do field/method injection: application, activity, service and view scopes
Instead, we want to have specialized annotations (similar to ContributesFragment, etc) for these entities

Convention:
ContributesXyz => constructor injection. E.g ContributesFragment
ContributesXyzInjector => field/method injection. E.g ContributesActivityInjector. This is to avoid any confusion about whether these entities support constructor injection

Concern
ContributesXyzInjector can be quite long. E.g ContributesApplicationInjector. So I decided to shorten this specific one to ContributesAppInjector. But I wonder if we can still find a better naming for them in general

Flexibility
This PR introduces a new AutoInjectorBinding meta-annotation, similar to the existing AutoScopedBinding (now renamed to AutoInstanceBinding). These annotations may be used outside of whetstone to mark user-land annotations so that they can be automatically processed by whetstone-compiler for either constructor (instance) or field/method (injector) injections. Note: this API is still marked as InternalWhetstoneApi for now

@kingsleyadio kingsleyadio merged commit 17b54ff into main Sep 26, 2022
@kingsleyadio kingsleyadio deleted the task/dynamic-injector-bindings branch September 26, 2022 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants