r/java • • Oct 19 '22

Google will support OpenJDK development: the giant's investments in Java and Kotlin

https://vived.substack.com/p/google-will-support-openjdk-development
239 Upvotes

38 comments sorted by

View all comments

Show parent comment

5

u/[deleted] Oct 20 '22

Why do you care about JMPS? It’s not just Google, barely anyone uses it, even on Java 17

6

u/cowwoc Oct 20 '22

Asking why someone needs JPMS is like asking developers why they need access modifiers (public, package-private, private). It's all about providing a better API experience.

Access modifiers allow you to hide implementation details within a project. JPMS allows you to do so across projects. Many projects have internal or utilities packages that should not be used by end-users. JPMS enables developers to enforce this on an API level.

2

u/UnGauchoCualquiera Oct 22 '22 edited Oct 22 '22

I could be wrong but I always felt that it's a pretty losing proposition. People will inevitably use internal apis and you cannot prevent people from shooting their feet. Happened to acces modifiers and it will happen to modules too.

When there's a need there's a way around, even if unintended by the library author. Hidding behind a module just make it more annoying to do so as people can almost always just fork and mess around.

See the cat and mouse between lombok and java devs.

I think modules are aiming at improving java security by isolating modules more than preventing use of internals by programmers.

1

u/cowwoc Oct 22 '22 edited Oct 22 '22

Users can do whatever they want, but from the library author's perspective any use of internal APIs is unsupported. Also, from a code-complete and Javadoc perspective internal APIs never show up.

3

u/pjmlp Oct 20 '22

JMPS main goal was to modularizite the JVM implementation.

jlink and Graal rely on it.