Win a copy of High Performance Python for Data Analytics this week in the Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Sybex 819 - Automatic modules - Java OCP 11 Programmer II Study Guide

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a query about Automatic modules.
On Chapter 6 in the Java OCP 11 Programmer II Study Guide by Scott Selikoff and Jeanne Boyarsky it's written "A key point to remember is that code on the classpath can access the module path. By contrast, code on the module path is unable to read from the classpath."
Also, looking at Table 6.3 (see attachment) I understand that Automatic modules cannot access unnamed modules on the classpath.

However, I read elsewhere the following:
Remember that modular code cannot access code present on the -classpath but "automatic modules" are an exception to this rule. When a non-modular jar is put on --module-path, it becomes an "automatic module" but it can still access all the modular as well as non-modular code. In other words, a class from an automatic module can access classes present on --module-path as well as on -classpath without having any "requires" clause

Did I misunderstand the information in Java OCP 11 Programmer II Study Guide?


Screenshot-2020-12-19-at-15.14.26.png
TABLE 6.3 - Properties of modules types
TABLE 6.3 - Properties of modules types
 
author & internet detective
Posts: 40393
821
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Automatic modules are on the module path. That's a key difference between an automatic module (module path) vs unnamed module (classpath)
 
Ranch Hand
Posts: 41
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Early Charlemagne wrote:Hi,

I have a query about Automatic modules.
On Chapter 6 in the Java OCP 11 Programmer II Study Guide by Scott Selikoff and Jeanne Boyarsky it's written "A key point to remember is that code on the classpath can access the module path. By contrast, code on the module path is unable to read from the classpath."
Also, looking at Table 6.3 (see attachment) I understand that Automatic modules cannot access unnamed modules on the classpath.

However, I read elsewhere the following:
Remember that modular code cannot access code present on the -classpath but "automatic modules" are an exception to this rule. When a non-modular jar is put on --module-path, it becomes an "automatic module" but it can still access all the modular as well as non-modular code. In other words, a class from an automatic module can access classes present on --module-path as well as on -classpath without having any "requires" clause

Did I misunderstand the information in Java OCP 11 Programmer II Study Guide?




Hi,

Unnamed modules are on the classpath. They can access JAR files on both the classpath and the module path.

Named modules are on the module path, they cant access any unnamed module.

Automatic module are on the module path, they can access all the modular as well as non-modular code.

For example, using Bottom-Up migration strategy, you have a mix of named and unnamed modules.The named modules are the low-level that have been migrated. They are on the module path and not allowed to access any unnamed modules, but the high-level that have not been migrated are unnamed and they access the low-level(named).

Another example, top-down migration, you move all projects to module path(now they are automatic modules), then you choose the first module that has more dependencies to add the module-info to convert the automatic module into a named module. If the modules that are low-level(have less dependence) were unnamed (that is, they were in the classpath) this strategy would not work, since named modules cannot access unnamed modules.Thats why you must move all projects to module path, using this strategy.
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic