Services and Bindings - expected usage scenarios
Pisarev, Vitaliy
vitaliy.pisarev at hpe.com
Tue Nov 29 14:54:35 UTC 2016
Yes I have. In fact I've watched the entire series and am following this very closely for a time now.
The lecture clearly explains the mechanics and how this works and what we *can* do with it, but less about what we *should* (and shouldn’t) do with it.
I am a System Architect in a very large scale project. As such I have a lot of influence on the way and the speed our product assimilates new features.
(For example, I made sure everybody is proficient in lambda/streams even before Java 8 was GA so the adoption was smooth and very fast).
I am looking at the great features in Java 9 and I know that we are going to "jump" on the new module system with all the encapsulation it gives us.
But I and my fellow Architects are very unsure what to think of the ServiceLoader.
Some of the push-back I get is that it is a "low level component" meant for authors of infrastructure libraries.
Others tell me to forget about using the ServiceLoader as a Service Locator and stick
to good old Spring. Yet others tell me that the Java Expert group has actually taken a stand in the "Dependency Injection vs ServiceLocator" debate, by streamlining
the ServiceLocator pattern instead of going with JDK level Dependency Injection.
Discussions are heated, and I figured to go to the source instead of deducing our own conclusions with so little information.
-----Original Message-----
From: Alan Bateman [mailto:Alan.Bateman at oracle.com]
Sent: יום ג 29 נובמבר 2016 15:24
To: Pisarev, Vitaliy <vitaliy.pisarev at hpe.com>; jigsaw-dev at openjdk.java.net
Subject: Re: Services and Bindings - expected usage scenarios
On 29/11/2016 13:13, Pisarev, Vitaliy wrote:
> What about the intent behind how are developers supposed to use this tool?
>
> For example, when Optional was introduced in Java 8, it was specified
> that it is intended to be used as a methods return type. And people should not use it as class member or method argument, even though the compiler will not prevent them to.
>
> Here is a language feature that comes with guidelines as to how it is intended to be used.
>
> Can you tell me how the expert group envisions usage of the ServiceLoader in Java 9, with reference to the original question (and any other thing you can add with regard to this).
>
Have you looked at Alex's presentation on "Modules and Services" from JavaOne 2016 [1]?
-Alan
[1] http://openjdk.java.net/projects/jigsaw/talks/#j1-2016
More information about the jigsaw-dev
mailing list