Patterns and Practices for Developing Maintainable Applications
1234567

Java 9 introduces a module system to the platform. This is a major leap, marking the start of a new era for modular software development on the Java platform. We’re very excited about these changes, and we hope you are too after reading this book. You’ll be ready to make the best use of the module system before you know it.

Who Should Read This Book

This book is for Java developers who want to improve the design and structure of their applications. The Java module system improves the way we can design and build Java applications. Even if you’re not going to use modules right away, understanding the modularization of the JDK itself is an important first step. After you acquaint yourself with modules in the first part of the book, we expect you to also really appreciate the migration chapters that follow. Moving existing code to Java 9 and the module system will become an increasingly common task.

This book is by no means a general introduction to Java. We assume you have experience writing relatively large Java applications in a team setting. That’s where modularity becomes more and more important. As an experienced Java developer, you will recognize the problems caused by the classpath, helping you appreciate the module system and its features.

There are many other changes in Java 9 besides the module system. This book, however, focuses on the module system and related features. Where appropriate, other Java 9 features are discussed in the context of the module system.

Why We Wrote This Book

We have been Java users since the early days of Java, when applets still were hot stuff. We’ve used and enjoyed many other platforms and languages over the years, but Java still remains our primary tool. When it comes to building maintainable software, modularity is a key principle. Pursuing modular application development has become somewhat of a passion for us, after spending a lot of energy building modular software over the years. We’ve used technology such as OSGi extensively to achieve this, without support in the Java platform itself. We’ve also learned from tools outside the Java space, such as module systems for JavaScript. When it became clear that Java 9 would feature the long-awaited module system, we decided we didn’t want to just use this feature, but also help with onboarding other developers.

Maybe you have heard of Project Jigsaw at some point in the past decade. Project Jigsaw prototyped many possible implementations of a Java module system over the course of many years. A module system for Java has been on and off the table several times. Both Java 7 and 8 were originally going to include the results of Project Jigsaw.

With Java 9, this long period of experimentation culminates into an official module system implementation. Many changes have occurred in the scope and functionality of the various module system prototypes over the years. Even when you’ve been following this process closely, it’s difficult to see what the final Java 9 module system really entails. Through this book, we want to provide a definitive overview of the module system. And, more important, what it can do for the design and architecture of your applications.

Sander Mak

Sander Mak is a Fellow at Luminis in The Netherlands, where he crafts modular and scalable software. Most often on the JVM, but with a touch of TypeScript where needed. He writes, is an avid conference speaker and loves sharing knowledge through his blog at branchandbound.net, and also as a Pluralsight instructor.

Paul Bakker

Paul Bakker is a software architect for Luminis Technologies. His current focus is on building modular enterprise applications and the cloud. He believes that modularity and the cloud are the two main points we have to deal with to bring technology to a next level, and is working on making this possible for main stream software development. Today he is working on educational software focussed on personalised learning for high school students in the Netherlands. He is also responsible for pushing technology forward. Luminis strongly believes in open source and all the technology development they are doing happens in the open source community. Paul is an active contributor on projects such as Amdatu, Apache ACE, JBoss Forge and BndTools. He has a background as trainer on Java related technology and is a regular speaker on conferences.