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

Pluggable Dependency Injection setup #25

Open
OlegDokuka opened this issue Jan 7, 2019 · 0 comments
Open

Pluggable Dependency Injection setup #25

OlegDokuka opened this issue Jan 7, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@OlegDokuka
Copy link
Member

OlegDokuka commented Jan 7, 2019

Actual Behaviour

At the moment, all generated server RSocket are marked with javax @Inject + @Named annotations which decrease the level of flexibility regarding using the library. From my experience, most of the injections are done through the explicit declaration of the configurations (e.g., Spring Boot configurations + beans) or modules in Dagger 2. First of all, such an aggressive injection decrease the flexibility in software testing because a usual classpath scanning will eagerly include all annotation's marked classes and inject them to test, so the user would have to hack framework for injecting mocks.

Expected Behavior

As a lib user, I want to have DI standards-free library, so I will be able to choose preferable DI solution, customize dependency injection in my application and keep it highly testable.

Proposal

As a compromise, I propose to have an additional flag for a protobuf plugin similar to what mapstruct has -> http://mapstruct.org/news/2018-07-15-mapstruct-1_3_0_Beta1-is-out-with-builder-support/#constructor-injection-for-annotation-based-component-models which make it possible to enable DI annotations on the generated classes.

With that addition, each user of RSocket-RPC-Java library will be able to turn on/off explicit dependency injection on demand

@OlegDokuka OlegDokuka added the enhancement New feature or request label Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant