Book description
Java's much-awaited "Project Jigsaw" is finally here! Java 11 includes a built-in modularity framework, and The Java Module System is your guide to discovering it. In this new book, you'll learn how the module system improves reliability and maintainability, and how it can be used to reduce tight coupling of system components.
About the Technology
Packaging code into neat, well-defined units makes it easier to deliver safe and reliable applications. The Java Platform Module System is a language standard for creating these units. With modules, you can closely control how JARs interact and easily identify any missing dependencies at startup. This shift in design is so fundamental that starting with Java 9, all core Java APIs are distributed as modules, and libraries, frameworks, and applications will benefit from doing the same.
About the Book
The Java Module System is your in-depth guide to creating and using Java modules. With detailed examples and easy-to-understand diagrams, you’ll learn the anatomy of a modular Java application. Along the way, you’ll master best practices for designing with modules, debugging your modular app, and deploying to production.
What's Inside
- The anatomy of a modular Java app
- Building modules from source to JAR
- Migrating to modular Java
- Decoupling dependencies and refining APIs
- Handling reflection and versioning
- Customizing runtime images
- Updated for Java 11
About the Reader
Perfect for developers with some Java experience.
About the Author
Nicolai Parlog is a developer, author, speaker, and trainer. His home is codefx.org.
We interviewed Nicolai as a part of our Six Questions series. Check it out here.
Quotes
Nicolai’s care and attention to detail allow you to take advantage of the distillation of his knowledge—from theory to practice, from entry level to advanced.
- From the Foreword by Kevlin Henney
A great introduction to modules in general, and Java 11 modules in particular.
- Mikkel Arentoft, Danske Bank
A clear and concise introduction to Java’s long-awaited module system.
- Jim Wright, Sword Apak
If you are serious about Java 11, you will need this book!
- Christian Kreutzer-Beck, ARAG Italy
Publisher resources
Table of contents
- The Java Module System
- Copyright
- dedication
- contents
- front matter
- Part 1. Hello, modules
-
1 First piece of the puzzle
- 1.1 What is modularity all about?
- 1.2 Module erasure before Java 9
-
1.3 Complications before Java 9
- 1.3.1 Unexpressed dependencies between JARs
- 1.3.2 Shadowing classes with the same name
- 1.3.3 Conflicts between different versions of the same project
- 1.3.4 Complex class loading
- 1.3.5 Weak encapsulation across JARs
- 1.3.6 Security checks have to be handcrafted
- 1.3.7 Poor startup performance
- 1.3.8 Rigid Java runtime
- 1.4 Bird’s-eye view of the module system
- 1.5 Goals of the module system
- 1.6 Skills, old and new
- Summary
-
2 Anatomy of a modular application
- 2.1 Introducing ServiceMonitor
- 2.2 Modularizing ServiceMonitor
- 2.3 Cutting ServiceMonitor into modules
- 2.4 Laying out files in a directory structure
- 2.5 Declaring and describing modules
- 2.6 Compiling and packaging modules
- 2.7 Running ServiceMonitor
- 2.8 Extending a modular code base
- 2.9 Post mortem: Effects of the module system
- Summary
- 3 Defining modules and their properties
- 4 Building modules from source to JAR
- 5 Running and debugging modular applications
- Part 2. Adapting real-world projects
- 6 Compatibility challenges when moving to Java 9 or later
- 7 Recurring challenges when running on Java 9 or later
- 8 Incremental modularization of existing projects
- 9 Migration and modularization strategies
- Part 3. Advanced module system features
- 10 Using services to decouple modules
- 11 Refining dependencies and APIs
- 12 Reflection in a modular world
- 13 Module versions: What’s possible and what’s not
- 14 Customizing runtime images with jlink
- 15 Putting the pieces together
- Appendix A. Class-path recap
- Appendix B. High-level introduction to the reflection API
- Appendix C. Observing the JVM with unified logging
- Appendix D. Analyzing a project’s dependencies with JDeps
- Appendix E. Targeting multiple Java versions with multi-release JARs
- Index
- Lists of Figures, Tables and Listings
Product information
- Title: The Java Module System
- Author(s):
- Release date: July 2019
- Publisher(s): Manning Publications
- ISBN: 9781617294280
You might also like
book
Reactive Systems in Java
Reactive systems and event-driven architecture are becoming indispensable to application design, and companies are taking note. …
book
Modern Java in Action
Manning's bestselling Java 8 book has been revised for Java 9 and 10! In Modern Java …
book
More Java 17: An In-Depth Exploration of the Java Language and Its Features
Work with the essential and advanced features of the Java 17 release. This book covers features …
video
Java 8 Fundamentals: Modern Java Development with Lambdas, Streams, and Introducing Java 9’s JShell and the Java Platform Module System (JPMS)
54+ hours of video instruction. Overview The professional programmer’s Deitel® video guide to Java™ SE 7 …