编程语言
首页 > 编程语言> > java – ResolvedModule,Module和Observable Module之间的区别是什么

java – ResolvedModule,Module和Observable Module之间的区别是什么

作者:互联网

以下各项状态的文档如下:

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.

问: – 这两者有什么不同,是在编译和运行时还是只是模块的不同表示?

另一方面,the module-path定义

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.

问: – 所有这些都相关吗?有人可以举例说明如何以及在什么时间解释这个概念?

解决方法:

从指定了分辨率的java.lang.module包描述开始,您将了解可读性和可读性图.

然后查看Configuration类作为Configuration对象封装可读性图.图中的每个顶点都由ResolvedModule表示.

获得配置后,您可以考虑将其实例化为Java虚拟机中的模块图.这将导致您使用java.lang.ModuleLayer API.

我认为问题的一部分是询问模型世界ResolvedModule和运行时模块之间是否存在1-1关系.通常是,但没有什么可以阻止您多次实例化配置,这将导致从相同配置创建多个模块层.

现在考虑可能太多了,最好在去那里之前消化设计和API.

标签:java,java-9,jigsaw,java-module
来源: https://codeday.me/bug/20190608/1196061.html