What is the difference between ResolvedModule, Module and Observable Module
Asked Answered
K

2

5

The documentation for each of these states following:

ResolvedModule

A module in a graph of resolved modules. ResolvedModule defines the configuration method to get the configuration that the resolved module is in. It defines the reference method to get the reference to the module's content.

Module

Represents a run-time module, either named or unnamed.

Q:- When does these two differ, is it at the compile and the run time or is it just different representation of a module?

On the other hand, the module-path defines

The modules built-in to the compile-time or run-time environment, together with those defined by artifacts on the module path, are collectively referred to as the universe of observable modules.

Q:- Are all these related? Could someone please draw an example of how and at what time to explain the concept?

Kellar answered 20/9, 2017 at 19:57 Comment(0)
O
3

Start with the java.lang.module package description where resolution is specified and you will learn about readability and readability graphs.

Then look at the Configuration class as a Configuration object encapsulates a readability graph. Each vertex in the graph is represented by a ResolvedModule.

Once you have a Configuration then you can think of instantiating it as a graph of modules in the Java Virtual Machine. This will lead to you the java.lang.ModuleLayer API.

I think part of the question is asking if there is a 1-1 relationship between the model world ResolvedModule and the run-time Module. Usually yes, but there is nothing to stop you instantiating a Configuration multiple times which will result in several module layers created from the same configuration.

It's probably too much to be thinking about now, best to digest the design and API before going there.

Overrule answered 21/9, 2017 at 11:12 Comment(2)
thanks for providing an overview ..how about the term observable modules used in the sotms? ... best to digest the design and API before going there. ..indeed, would take some time to chew upon that answer ;)Kellar
also I haven`t found a good explanation of what upgradeable module isBrunhilde
E
4

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

  • Module: colloquially used to describe anything modular artifact (modular JARs or JMOD)
  • Observable Module: module in the runtime image or the on the module path
  • Resolved Module: observable module that was added to the module graph during module resolution
Ernest answered 20/9, 2017 at 21:57 Comment(1)
Thanks. I was able to infer the basic context but I am precisely looking for the use of these specific classes. Even the difference or similarities between the two classes should be quite clear with such an example I believe.Kellar
O
3

Start with the java.lang.module package description where resolution is specified and you will learn about readability and readability graphs.

Then look at the Configuration class as a Configuration object encapsulates a readability graph. Each vertex in the graph is represented by a ResolvedModule.

Once you have a Configuration then you can think of instantiating it as a graph of modules in the Java Virtual Machine. This will lead to you the java.lang.ModuleLayer API.

I think part of the question is asking if there is a 1-1 relationship between the model world ResolvedModule and the run-time Module. Usually yes, but there is nothing to stop you instantiating a Configuration multiple times which will result in several module layers created from the same configuration.

It's probably too much to be thinking about now, best to digest the design and API before going there.

Overrule answered 21/9, 2017 at 11:12 Comment(2)
thanks for providing an overview ..how about the term observable modules used in the sotms? ... best to digest the design and API before going there. ..indeed, would take some time to chew upon that answer ;)Kellar
also I haven`t found a good explanation of what upgradeable module isBrunhilde

© 2022 - 2024 — McMap. All rights reserved.