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
Simplify core elements initialization with Spring #6882
Simplify core elements initialization with Spring #6882
Conversation
ccd0eaa
to
2cd143b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functional annotation @UseCase
is definitely a better choice, but I would not have a separate @TransactionalUseCase
...apim-rest-api-service/src/main/java/io/gravitee/apim/core/api/use_case/ImportCRDUseCase.java
Outdated
Show resolved
Hide resolved
2cd143b
to
61e0688
Compare
Passing run #855 ↗︎
Details:
Review all test suite changes for PR #6882 ↗︎ |
61e0688
to
9ba8142
Compare
...pim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/apim/core/UseCase.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done 👏🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not forget to squash to avoid having the commit with the ComponentScan using pattern as it is not relevant anymore
Also declare alternative in InMemoryConfiguration
9ba8142
to
f2a35b8
Compare
This will allow to configure Spring component scan to init use cases.
This will allow to configure Spring component scan to init all services.
f2a35b8
to
56dd256
Compare
56dd256
to
4a9bf57
Compare
Description
The PR tries to simplify the spring configuration related to core elements.
As we don't want to reference Spring in the Core package, declaring beans was cumbersome because we had to add them in a Configuration file manually.
This PR suggests 2 remediations based on
@ComponentScan
annotation:domain_service
...@UseCase
and@DomainService
. Then, we can configure Component Scan to search for that annotation to discover beans.I like the second approach for 2 reasons:
Additional context
📚 View the storybook of this branch here