Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Extract DI to separate module #711
Extract DI to separate module #711
Changes from 59 commits
dad2bd9
3d4011c
26c3442
0c89c39
07a5650
6140c6d
c48041b
7d969cb
4cbd2ac
60215ec
c4ae568
5c759de
d34362b
afee8d0
5fc6cac
695b7e8
c73d5e4
5cde334
5deffbc
0f14e42
4ad59b0
9c001be
e8147b0
65d02a0
3faf17a
6914527
7eae1a7
5b98d7c
22b88fc
8e48b22
5dcfa30
5f6c4b2
8145b05
598250e
a22dcbe
cc4711d
50c3cc7
8550e06
13b2403
1895d8f
117fb11
ade6485
e6d17bd
096c14a
39d7e30
c1a2842
f81d2c9
e56245a
5a9fdcb
cec7371
01b8530
f3eee6c
ccff077
51796af
d07e90a
09a920e
f51d0b6
2de26b8
03aa5e1
0d81eee
b25f026
1ecb7a7
b91d749
592c398
4ee55fb
9d060da
02eee19
e677a73
c20ede7
d7a3771
3b20f33
3d62277
ed75878
7a0bd3a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
All is cool with this interface. It shouldn't be deprecated. I still want to use good-old approach with
.services(Object... ) / .services(ServiceInfo... )
orservices(ServiceProvider)
. Keepdeprecated
mentioned top level functions on Microservices (or how u call it here Scalecube), but decalre them on theScaleCubeServicesProvider
(with the same fluent API style).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.
Sometimes you have to throw away the old one and move on :) And seriously, this API is deprecated for the following reason: we delegate tasks to store and manage service life cycle to ServiceFactory (ex ServicesProvider) implementations. Scalecube (Microservices) should not perform such tasks, imho. Especially if we allocate a separate component that solves these tasks, I see no sense in leaving the old API, it's better to transfer these methods to the new one. As an option, you can add
registerDefinition(ServiceInfo serviceInfo)
and<T> registerDefinition(Supplier<T> instanceSupplier, Class<T> type, Tag... tags)
methods to ServiceFactory (ex ServiceProducer).In the end.
.services(ServiceInfo... services)
in Scalecube (Microservices);P.S. During development, I added the registration of additional services through
register(ServiceInfo service)
but decided to remove it because it violated the immunity of the ServiceFactory (ServicesProvider).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.
its ok to deprecate .services(ServiceInfo... services) but we cant just do that without discussing the public api.
services is used in all the examples and documentations and we need to direct the users as part of this pull request to a proper use of the api with examples / readme / website and basically everywhere.
plust we are changing this method we also need to discuss the public api from end user point of view. we need to review it to make sure its clean and easy to use.
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.
@ronenhamias So api is not removed, but @deprecated :)
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.
Correct. We don't want
.services(Object... ) / .services(ServiceInfo... ) or services(ServiceProvider)
onMicroservices
anymore. That's why:Next.
We don't need options. We need clear and well understood approach. Shall we discuss it here? No. Not in the scope of this PR. That's why:
Upon this one.
Good. But not in this PR. In this PR we will keep them but just move to another place.
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.
@eutkin @eutkin
Coming back to this question.
Again, why those methods were deprecated:
Can't u keep them and use ScalecubeServiceFactory which will be defined internally?
I.e first three works with internal ScalecubeServiceFactory (client will not know even) + last one allows to specifiy explicitly serviceFactory. This way u would not need to deprecate you would just expose internal toolset called
ServiceFactory
.