You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: