- Modular Programming in Java 9
- Koushik Kothagal
- 270字
- 2021-07-02 18:38:20
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.
- SQL Server 從入門到項目實踐(超值版)
- 少兒人工智能趣味入門:Scratch 3.0動畫與游戲編程
- Spring 5.0 By Example
- Building a Game with Unity and Blender
- Magento 2 Development Cookbook
- 編譯系統透視:圖解編譯原理
- 網絡爬蟲原理與實踐:基于C#語言
- Hands-On Swift 5 Microservices Development
- D3.js 4.x Data Visualization(Third Edition)
- PLC應用技術(三菱FX2N系列)
- Modern C++ Programming Cookbook
- 零基礎學C語言(第4版)
- Hack與HHVM權威指南
- PostgreSQL 12 High Availability Cookbook
- SaaS攻略:入門、實戰與進階