What is the difference between ResolvedModule, Module and Observable Module

Documentation for each of the following conditions:

ResolvedModule

The module in the allowed modules column. The ResolvedModule defines the configurations in order to get the configuration in which the allowed module is located in. It defines a reference method to get a link to the contents of the module.

Module

Represents a run-time module, called or unnamed.

Q: - When these two are different from each other, is it during compilation and runtime, or is it just another representation of the module?

On the other hand, the path to the module determines

Modules embedded in a compilation or runtime environment, together with those identified by artifacts on the way to the module, are collectively referred to as the universe of observable modules.

Q: - Is all this connected? Could someone please draw an example of how and at what time to explain the concept?

+5
source share
2 answers

Start by describing the java.lang.module , where permission is given, and you will learn about the readability and readability graphs.

Next, consider the Configuration class, because the Configuration object encapsulates the readability graph. Each vertex in the graph is represented by the symbol ResolvedModule .

After you have the Configuration, you can think about how to create an instance in the form of a graph of modules in the Java virtual machine. This will bring you the java.lang.ModuleLayer API.

I think part of the question is asking if there is a relationship between the model world of the ResolvedModule and the runtime of the Module . Usually yes, but there is nothing to prevent you from instantiating the configuration several times, which will lead to the creation of several modules created from the same configuration.

Probably too much to think about yourself now, it’s best to digest the design and APIs before heading there.

+3
source

If you are looking for an answer that describes the use of these specific classes, I'm not in my depth, but this is the meaning of these terms in a slightly smaller technical context:

  • Module : colloquially used to describe any modular artifact (modular JAR or JMOD).
  • Observed module : module at run time or on the way to the module
  • Solved module : the observed module that was added to the module graph during module resolution
+1
source

Source: https://habr.com/ru/post/1271996/


All Articles