preface

The module system and I met one early morning in April 2015. Before going to work, I checked the OpenJFX mailing list and skimmed a message from a JavaFX user who was concerned about private APIs becoming unavailable “due to modularity restrictions.” No way, I remember thinking; Java would never undergo such an incompatible change. I wrote it off as a misunderstanding and headed out to work.

There, after lunch, I had a small dispute with a colleague. Nothing consequential, but it left me somewhat disgruntled, so I decided to go home early and enjoy the sunny spring day. Out on the balcony with a cool beer, I needed something to read. But what? Out of curiosity, I started going through the replies to the mail I skimmed that morning—and they sucked me right in!

Over the following weeks I devoured every piece of information I could find about Project Jigsaw, the roof under which the module system was being developed. It turned out that the JavaFX user’s concerns were absolutely justified.

In the beginning, I mostly focused on all the things that might break on Java 9. The potential benefits, on the other hand, were a little less obvious. Fortunately, at the time, I was working on a large Java application, and it slowly began to dawn on me how the module system could be used to improve and maintain its overall structure. More and more pieces fell into place, and after a couple of weeks I was sold on the idea of introducing modules into the ecosystem—even if that meant breaking a few things.

The journey from compatibility concerns to understanding the underlying reasons to appreciating what the module system has to offer is a common one. But not the only one! Instead of worrying about existing code bases, you may want to evaluate the module system for your next greenfield Java project; or maybe you’re more interested in the larger impact of modularity on the ecosystem. Wherever your journey starts, I wrote this book to be your guide.

If you wonder where the journey leads, think back to Java 8. It introduced lambda expressions—but more important than that language feature on its own is its continued effect on the community and ecosystem: it introduced millions of Java developers to the basics of functional programming and sent us on a journey that opened our eyes to new concepts, making us stronger developers in the process. It also spurred a lot of new libraries and even taught existing frameworks a thing or two.

Keep that in mind when thinking about the module system. It’s more than just a language feature; it will send us on a journey to learn more about modularity in all its forms and how to properly design and maintain large software projects, and will spur better support for modularity by libraries, frameworks, and tools. It will make us stronger developers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.134.130