Master design patterns and best practices to build truly modular applications in Java 9
Upgrade your old Java code to Java 9 with ease
Build and run a smooth functioning multi-module application.
Description
The Java 9 module system is an important addition to the language that affects the way we design, write, and organize code and libraries in Java. It provides a new way to achieve maintainable code by the encapsulation of Java types, as well as a way to write better libraries that have clear interfaces. Effectively using the module system requires an understanding of how modules work and what the best practices of creating modules are.
This book will give you step-by-step instructions to create new modules as well as migrate code from earlier versions of Java to the Java 9 module system. You'll be working on a fully modular sample application and add features to it as you learn about Java modules. You'll learn how to create module definitions, setup inter-module dependencies, and use the built-in modules from the modular JDK. You will also learn about module resolution and how to use jlink to generate custom runtime images.
We will end our journey by taking a look at the road ahead. You will learn some powerful best practices that will help you as you start building modular applications. You will also learn how to upgrade an existing Java 8 codebase to Java 9, handle issues with libraries, and how to test Java 9 applications.
Who is this book for?
This book is written for Java developers who are interested in learning and understanding the techniques and best practices to build modular applications in Java. The book assumes some previous programming experience in Java 8 or earlier, familiarity with the basic Java types such as classes and interfaces, as well as experience in compiling and executing Java programs.
What you will learn
• Get introduced to the concept of modules and modular programming by working on a fully modular Java application
• Build and configure your own Java 9 modules
• Work with multiple modules and establish inter-module dependencies
• Understand and use the principles of encapsulation, readability, and accessibility
• Use jlink to generate fully loaded custom runtime images like a pro
• Discover the best practices to help you write awesome modules that are a joy to use and maintain
• Upgrade your old Java code to use the new Java 9 module system
This is one of the best book I came across recently. Author had really explained the topics well so as to understand the core concepts of Modular Programming in Java 9. I will certainly recommend this book to readers !!
Amazon Verified review
Mozart BrocchiniSep 07, 2017
4
Disclaimer: I was a technical reviewer of this book.The author gently introduces all concepts and then applies them with simple code examples or executing new commands on the terminal that were specifically added to Java 9 to help with modularity features.You will start by learning what problems the modularity features solve, then learn how to create your first module and progress incrementally all the way up to migrating existing code to java 9 and ultimately using modules with build tools and testing modules. You will also learn how the Java platform itself has been modularized and what benefits that brings. There is a new game changer feature that you shouldn't miss, the linking development phase which happens between compiling and executing code. Linking allows you to create self contained lightweight runtime images for your application with the usage of jlink tool rather then having to deploy the entire rt.jar like we did with previous versions of Java.I started reading this book with a lot of skepticism, my initial thinking was "Does modularity add any value to software development in today's world where modern architectures just expose APIs backed by microservice back ends ?". Well, it turns out that some of the new modularity features added to Java 9 like linking, actually help with creating more lightweight services.Fortunately, it turns out that this book will help Java 9 programmers with all the tasks related to modularity, including module design, best practices and patterns for modularizing new applications as well as retrofitting existing monoliths into modular systems which could later be broken into standalone microservices.I'm giving a four star rating based on topic coverage and accuracy, this book is excellent because it has everything you need to know about modularity with Java 9, you will find articles on web containing certain concepts but likely all articles will be incomplete and you will be only getting part of what Java 9 modules are about. While it is tempting to jump into learning the modularization features based on short tutorials, the modularity features are game changers and may only disappoint you if you start with a high level of frustration when failing to get things things done because of lack of knowledge. Just to give you and idea on how Java 9 is different, in Java 9 modular development, the classpath is no longer used to find dependencies.I obviously have not read all Java 9 books and never will, but my guess is that even Java 9 books that are not specifically targeting modularity will likely be short in modularity content.What could be improved:A few examples are based on older architectures and practices, those examples were chosen to exemplify some problems that modularity solve, but those issues no longer exist in more modern applications using microservices architecture and DevOps automation practices.Also, sometimes the topics feel a bit long for an experienced architect like me who wants to go right to the point.The verdict:If you are willing to learn Java modularity the right way, or have a complete reference focused exclusively on the new modularity features added in Java 9, this book is for you.
Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.
If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.
Please Note: Packt eBooks are non-returnable and non-refundable.
Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:
You may make copies of your eBook for your own use onto any machine
You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website?
If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:
Register on our website using your email address and the password.
Search for the title by name or ISBN using the search option.
Select the title you want to purchase.
Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title.
Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook?
If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
To view your account details or to download a new copy of the book go to www.packtpub.com/account
Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.
You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.
What are the benefits of eBooks?
You can get the information you need immediately
You can easily take them with you on a laptop
You can download them an unlimited number of times
You can print them out
They are copy-paste enabled
They are searchable
There is no password protection
They are lower price than print
They save resources and space
What is an eBook?
Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.
When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.
For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.