The documentation for each of these states following:
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?
The biggest difference is that Promises won't change their value once they have been fulfilled. They can only emit (reject, resolve) a single value. On the other hand, observables can emit multiple results. The subscriber will be receiving results until the observer is completed or unsubscribed from.
Promises deal with one asynchronous event at a time, while observables handle a sequence of asynchronous events over a period of time. Emit multiple values over a period of time. Emit a single value at a time. Are lazy: they're not executed until we subscribe to them using the subscribe() method.
In comparison to a regular Observable, a Subject allows values to be multicasted to many Observers. A Subject and its subscribers have a one-to-many relationship. A Subject can be an Observable as well as an Observer. They hold a registry of many listeners to multiple Observables.
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.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With