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

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.

主站蜘蛛池模板: 时尚| 建瓯市| 梁山县| 江油市| 淮北市| 永清县| 松潘县| 苏尼特右旗| 昌吉市| 宁海县| 马龙县| 大同市| 汝南县| 镇康县| 普陀区| 湖南省| 井陉县| 二连浩特市| 正安县| 东光县| 罗江县| 综艺| 濮阳市| 九寨沟县| 陆丰市| 金塔县| 青河县| 卓尼县| 桂平市| 扶沟县| 确山县| 衡阳县| 浮梁县| 福州市| 渑池县| 宁蒗| 弥渡县| 五指山市| 县级市| 银川市| 陕西省|