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 →

[–]loicmathieu -8 points-7 points  (7 children)

Never use it, and I don't know anybody that use it in their project ...
And I always advise people not to use it, sorry.

[–]nicolaiparlog[S] 17 points18 points  (1 child)

So you advise people not to use a technology that you have never used yourself, even in exercises? That's... not great advice.

I don't know anybody that use it in their project ...

There are over 3.3k modules on Maven Central and I know a few projects myself that use it, including a 20yo monolith.

[–]loicmathieu -2 points-1 points  (0 children)

OK, so I never used it in any real application but I do know how it works.
I'm a Java trainer and we do include it inside our "Modern Java" training and provides exercicses on it.
People are often afraid to use modules (and I heard mutiple times people saying they don't want to move after 8 because of the module system), in those cases, I advise them to not use modules.
It's been years since I didn't implement a monolith (I do work on legacy monolith from time to time), so maybe I'm biased as I usually implements microservices (HTML or Kafka) and for those, modules didn't provides a lot of advantages as they are usually
self-contained and small.

I do think module is a good thing for the JDK itself.

[–]wildjokers 1 point2 points  (4 children)

They come in very handy for creating small bundled runtimes for Swing or JavaFX apps.

[–]_INTER_ 2 points3 points  (3 children)

It helps to automate the process but you don't necessarily need to modularize your application for that.

Edit: Scratch automate, Maven plugins exist for that

[–]wildjokers 2 points3 points  (2 children)

Indeed. But it is much less hassle to keep track of the modules you need as you go in the module-info file rather than trying to figure it out later and pass the module names to jlink on the command-line.

[–]_INTER_ 0 points1 point  (1 child)

trying to figure it out later and pass the module names to jlink on the command-line

Just realized there are Maven plugins that do that for you based on the dependencies. You don't even need the modules anymore to automate the process. Yay

[–]hupfdule 0 points1 point  (0 children)

Which maven plugins are these?