A Module is a group of closely related packages and resources along with a new module descriptor file.
- 强封装。比如,jar下的public都是可访问的,但是对于mouble,则需要通过service、open、export来定义外部怎么使用module。
- 通过可靠的配置,期望替换目前脆弱、易出错的ClassPath机制。显示依赖,改进依赖管理。比如,进行模块后不必要每次运行程序都运行上百M的rt.jar。
Java 8的包之间的依赖关系
image
Java9的依赖关系(模块之间依赖关系)
image
网友评论