Java 9 Modularity

The Java module system offers new ways of creating modular and maintainable applications. With this hands-on book, Java developers will learn not only about the joys of modularity, but also about the patterns needed to create truly modular and reliable applications.

Authors Sander Mak and Paul Bakker teach you the concepts behind the Java module system, along with the new tools it offers. You’ll also learn how to modularize existing code and how to steer clear of common pitfalls when migrating to Java 9.

Why Modules?

The art of structuring large codebases is an undervalued one. This is neither a new
problem, nor is it specific to Java. However, Java is one of the mainstream languages
in which very large applications are built all the time—often making heavy use of
many libraries from the Java ecosystem. Under these circumstances, systems can outgrow
our capacity for understanding and efficient development. A lack of structure is
dearly paid for in the long run, experience shows.

Modularity is one of the techniques you can employ to manage and reduce this complexity.
Java 9 introduces a new module system that makes modularization easier and
more accessible. It builds on top of abstractions Java already has for modular development.
In a sense, it promotes existing best practices on large-scale Java development
to be part of the Java language.

The Java module system will have a profound impact on Java development. It represents
a fundamental shift to modularity as a first-class citizen for the whole Java platform.
Modularization is addressed from the ground up, with changes to the language,
Java Virtual Machine (JVM), and standard libraries.

Now is the time to read up on modules. JDK 9 itself is modularized (shown right) so you will encounter modules right from the start.
See how they can improve the structure and integrity of your applications.

— Introduction of Java 9 Modularity(Excerpt from Chapter 1)

About the Authors

Sander Mak

Sander is a Fellow at Luminis in The Netherlands. At Luminis, he crafts modular and scalable software, most often on the JVM but with a touch of TypeScript where needed. He is author of the O'Reilly book 'Java 9 Modularity' and an avid conference speaker.

Paul Bakker

Paul is a senior software engineer with Netflix in the Edge Developer Experience team, where he primarily works on tools to increase developer productivity within the company. Besides his love for writing code, he has a passion for sharing knowledge.

This is his second book after co-authoring "Modular Cloud Apps with OSGi" which was published by O'Reilly in 2013. Paul is also frequently speaking at conferences about modularity, container technology and many other topics. He blogs at http://paulbakker.io.

What Other People Say

Modularization is hard. Luckily I've been able to use Paul and Sander's book as my guide for writing my Java 9 tutorials, talks, and converting jClarity's applications to use Java's new modular system. I'm buying a copy for all the engineering team at jClarity, it's that good!

Martijn Verburg

CEO, jClarity and Java Champion

This book delivers the essential practical knowledge you need to create modular applications in Java 9. It's a must read for any developer or architect wanting to adopt one of the most significant features the JDK has seen in many years.

Simon Maple

Director of Developer Relations, ZeroTurnaround

Sander and Paul are expert practitioners of Java and trusted guides to the Java 9 ecosystem. They were on the front lines of Java 9’s development, and in the vanguard of efforts to migrate popular open source libraries. “Java 9 Modularity” is the handbook for everyone interested in the core principles and best practices of modularity in Java: application developers looking to create maintainable components; library developers looking for advice on migration and reflection; and framework developers wishing to exploit the module system’s advanced features. This book will help you to create Java programs whose structure lets them stand the test of time.

Alex Buckley

Java Platform Group, Oracle

Get the Book

Below you'll find a number of options to get Java 9 Modularity. Consider leaving a review after reading (for example, on Goodreads or Amazon), it is much appreciated!

Read Online

O'Reilly Safari offers the largest selection of IT books on a subscription basis. You can read Java 9 Modularity with a Safari subscription.

Pluralsight Course: What's New in Java 9

This 3,5 hour video course shows all important new features of Java 9 in a hands-on manner. Topics range from JShell to Stream/Optional API enhancements, new APIs like HttpClient and ProcessHandle, performance and security improvements in Java 9 and much more.