On 16/11/2015 19:41, Neil Bartlett wrote:
Thanks Alan,
So you’re saying that ServiceLoader is permitted to have “super powers” to
punch through encapsulation, but other libraries are not. This is disappointing
— ServiceLoader is extremely limited in functionality, and is no match for any
of the widely used DI frameworks like Spring, Guice, CDI etc. Why should this
library be blessed above all others?
It's never been a goal to create a new DI framework. However there is a
requirement to expose the service bindings via the ServiceLoader API [1]. Time
will tell if we have to introduce a way for frameworks and serialization
libraries to break encapsulation.
-Alan.
[1] http://openjdk.java.net/projects/jigsaw/spec/reqs/#binding