官术网_书友最值得收藏!

What is a module?

The module is a new construct that has been introduced into the Java 9 programming language. Think of modules as first-class citizens and as new program components in the language, just like classes or packages. A Java 9 module is a named, self-describing collection of code and data that you can create and use in Java applications. A module can contain any number of Java packages that in turn contain Java code elements, such as classes or interfaces. A Java module can also contain files such as resource files or property files. An application is built by bringing together a collection of these modules. The analogy of building blocks applies well here--a module is a building block that exists on its own, but can be a part of a bigger whole.

With Java 9 modular programming, we move away from building applications as monolithic code bases and instead look to break down the problem into modules. In other words, rather than having one big Java project, you create several modular units that work together to form an application.

This significantly influences how you design and code your application. In Java 8 and earlier, your design process involved breaking down the problem into classes and packages. In Java 9, you first break the problem down into modules. These modules are ideally components that are reusable with a clear interface (inputs and outputs) and solve a specific part of the problem. Inside each module, however, the process of designing and writing code is, more or less, business as usual with packages, classes, interfaces, and so on.

主站蜘蛛池模板: 竹北市| 太保市| 襄樊市| 河西区| 乡宁县| 松阳县| 安泽县| 新龙县| 瑞金市| 和林格尔县| 卓资县| 株洲县| 宜州市| 延吉市| 鹿泉市| 松滋市| 黔西| 南乐县| 嵩明县| 资讯 | 额尔古纳市| 新和县| 闸北区| 桃源县| 靖边县| 乌拉特中旗| 内黄县| 茂名市| 禄丰县| 阳西县| 馆陶县| 佛教| 洪湖市| 宝丰县| 兰溪市| 全南县| 阜阳市| 泰宁县| 凌源市| 开鲁县| 深水埗区|