Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Modular Programming in Java 9

You're reading from   Modular Programming in Java 9 Build large scale applications using Java modularity and Project Jigsaw

Arrow left icon
Product type Paperback
Published in Aug 2017
Publisher Packt
ISBN-13 9781787126909
Length 298 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Koushik Srinivas Kothagal Koushik Srinivas Kothagal
Author Profile Icon Koushik Srinivas Kothagal
Koushik Srinivas Kothagal
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Introducing Java 9 Modularity 2. Creating Your First Java Module FREE CHAPTER 3. Handling Inter-Module Dependencies 4. Introducing the Modular JDK 5. Using Platform APIs 6. Module Resolution, Readability, and Accessibility 7. Introducing Services 8. Understanding Linking and Using jlink 9. Module Design Patterns and Strategies 10. Preparing Your Code for Java 9 11. Migrating Your Code to Java 9 12. Using Build Tools and Testing Java Modules

The address book viewer application

Now that you are comfortable creating, compiling, and executing a simple Java 9 module, let's update it and start adding address book viewer functionality.

The following informal class diagram shows how we'll design the application classes to begin with:

The main class has the main() method that displays the list of contacts in ascending order, sorted by the lastName property. It gets the list of contacts by calling the ContactUtil.getContacts() method and it sorts it using SortUtil.sortList(). It then displays the list of contacts to the console.

We'll start with a new model class Contact, which represents a single piece of contact information. Apart from the obvious contact-related private member variables and getters and setters, this class also has a couple of additions that'll come in handy later:

  • The constructor with...
You have been reading a chapter from
Modular Programming in Java 9
Published in: Aug 2017
Publisher: Packt
ISBN-13: 9781787126909
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime