- Modular Programming in Java 9
- Koushik Kothagal
- 255字
- 2021-07-02 18:38:17
Legacy classes
A good example of classes that you don't need is the set of classes in the JRE related to CORBA. Ever heard of CORBA? If you haven't, don't despair. It's for a reason! It's an old technology that was introduced to the Java runtime back in version 1.4. It has mostly fallen out of popular use since then. Considering most applications don't use the CORBA technology anymore, wouldn't it be great if apps could be bundled with JREs that do not contain the unnecessary CORBA classes?
That's unfortunately not possible, again, because of rt.jar. Since everything gets bundled into a single runtime JAR, you cannot pick and choose what features you need. Everybody gets everything. And since the runtime has been increasing in size, so has the standalone deployable application. This is a more significant challenge when the runtime needs to be used on smaller devices with limited resources. If you are bundling the runtime with a simple Hello World application that uses just a handful of classes from the runtime, you have no option but to bundle a whole lot of unused classes in rt.jar with it. And, yes, even those old CORBA classes join in for the ride!
Java 8 introduced the concept of profiles, and with that, you can technically deploy smaller runtimes. But they do have some drawbacks. Also, this feature was just an initial step in the introduction of modularity features in Java 9 anyway. We'll examine compact profiles in detail in Chapter 4, Introducing the Modular JDK.
- Java程序設計(慕課版)
- AWS Serverless架構:使用AWS從傳統部署方式向Serverless架構遷移
- Learning Bayesian Models with R
- 秒懂設計模式
- Building Minecraft Server Modifications
- 手把手教你學C語言
- GeoServer Beginner's Guide(Second Edition)
- 深入淺出Serverless:技術原理與應用實踐
- Java系統化項目開發教程
- Python深度學習:模型、方法與實現
- 零基礎學Scratch 3.0編程
- The Statistics and Calculus with Python Workshop
- Java EE 8 and Angular
- C# 7.1 and .NET Core 2.0:Modern Cross-Platform Development(Third Edition)
- Windows 10 for Enterprise Administrators