This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Two Minor Things

 
Saloon Keeper
Posts: 1672
61
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. While all the original materials about JPMS used the code name Jigsaw, and code names are Very Cool, I notice that the preponderance of more recent material just uses the name "Java Platform Module System" and the acronym: "JPMS", neither of which appear in the forum name.  I am not against having Jigsaw in the Forum Title, but should it still be Primary when many people seeking information about it aren't even aware of its Code Name anymore?  Additionally, the simple word Modules is overloaded, it is not clear if the notions of Modules from other frameworks being used is pertinent to this forum, so by all means, leave that standalone word (Modules) in if this is still the right place in which to discuss usage of Modules OTHER than JPMS modules.

2. I was torn between posting this part in here and in OCJP forum.  The lovely Sybex 815 book says the following about the potential benefits of JPMS on performance:

Improved Performance
Since Java now knows which modules are required, it only needs to look at those at class loading time.  This improves startup time for big programs and requires less memory to run.

While these benefits may not seem significant for for the small programs we've been writing, they are far more important for big applications.  A web application can easily take a minute to start.  Additionally for some financial applications every millisecond of performance is important.



It was my impression that while all that is true, one thing that Java was formerly Very Bad At was tiny programs that get executed oodles of times, or kilo-oodles, even worse.  Maybe you have a process invoking lots of small independent programs at the same time.  I certainly have done that in the past...
They already discussed the ability to make custom runtime images using jlink, with Just What You Need in them.

Is there any benefit from having your very small programs use JPMS so that "Since Java now knows which modules are required, it only needs to look at those at class loading time.  This improves startup time for big small programs being executed quite frequently and requires less memory to run." ?  Or do we just "magically" get that benefit from using Java versions later than 8 whether or not we opt into JPMS?
 
Saloon Keeper
Posts: 13426
302
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the first time I came across the abbreviation JPMS. In which materials is it used?

I usually use the phrases "Java 9+ modules" or "project Jigsaw modules" if I want to differentiate them from NetBeans modules or Maven modules. Otherwise I just call them "modules".

Modules are not just good for performance. Let me quote from an answer I gave in another topic:

Stephan van Hulst wrote:You see, before Java 9 you had to dump all the libraries your application uses on the classpath, and let Java load all of them to figure out that a class you need is available. The module system allows Java to figure out what module a class is in before it loads the module. That way, only modules that you actually need are loaded, and they're loaded at the time they're needed and no sooner.

There's another even bigger advantage though: Before Java 9, the "public" keyword meant that a class can be accessed by every other class in the entire world. If a class was only intended for internal use in your library and you wanted to hide it from the rest of the world, you had to put it in the same package as all the other library classes that use it and make it package private. Since Java 9, you can make classes public and stick them in different packages of your library, but still hide them from classes outside the library, simply by not exporting the package that the class is in.

 
Jesse Silverman
Saloon Keeper
Posts: 1672
61
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yikes!  I'm glad I posted this after all.

I see that the term is never used in Chapter 7 of the Java SE 7 JLS, they just say "module, module, module..."

From:
https://en.wikipedia.org/wiki/Java_Platform_Module_System

The Java Module System was initially being developed under the Java Community Process as JSR 277 and was scheduled to be released with Java 7.

JSR 277 later was put on hold and Project Jigsaw[2] was created to modularize the JDK. This JSR was superseded by JSR 376 (Java Platform Module System).

Project Jigsaw was originally intended for Java 7 (2011) but was deferred to Java 8 (2014) as part of Plan B,[3] and again deferred to a Java 9 release in 2017.[4] Java 9 including the Java Module System was released on September 21, 2017.[5]



I looked at JSR 376, it calls the "Java Platform Module System" a "central component of Project Jigsaw."

So it appears that Project Jigsaw, despite being a codename, contains the JPMS (which maybe is limited to what was specified in JSR 376?) and more...I am not sure the full scope of the term yet.

Lots and lots of recent study materials (including ones we keep Errata for on this site and other "for sale" sources and a bunch of free stuff I've seen) are all just calling the new module-related stuff that is covered on the OCJP 819 JPMS.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic