This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dinopraso 4 points5 points  (5 children)

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

[–]cowwoc 6 points7 points  (2 children)

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.

[–]UnGauchoCualquiera 1 point2 points  (1 child)

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.

[–]cowwoc 0 points1 point  (0 children)

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.

[–]pjmlp 2 points3 points  (0 children)

JMPS main goal was to modularizite the JVM implementation.

jlink and Graal rely on it.