
Explore the Java platform module system and learn how modular software with modules and a module graph delivers stronger encapsulation, security, extensibility, and maintainability.
Explore the Java platform module system (jpms) and its motivation, goals, and anatomy, as modular programming gains separation of concerns and information hiding for secure, maintainable software.
In this lecture, we discuss the first and one of the most important goals that motivated the development of JPMS. The goal is motivated by the problems that JDK itself was facing.
Explore the motivation for separation of concerns in the Java platform module system, showing how modularity groups related packages into modules to ease understanding and maintenance.
Discover the anatomy of a Java module by examining module descriptors, the module-info.java, and the requires and exports directives that declare dependencies and visible packages.
Learn module path and module resolution in JPMS, identify explicit modules and modular jars, build a module graph, and enforce rules to prevent dependency issues.
Create modular jars for JPMS modules indexer and downloader using the jar tool, set up lib folders, and update manifests and module descriptors to designate entry points.
Explore JPMS module resolution checks, including missing dependencies, duplicate modules, split packages, and acyclic dependencies, with hands-on demos of module path, exports, and cyclic dependencies.
Create and configure java modules from within Eclipse using jpms. Define module-info.java, export downloader, create downloader and indexer modules, and set up the module path so indexer requires downloader.
Export downloader and indexer as modular jars from Eclipse, then run on the module path with -m and the entry point.
See how unnamed modules enable non-modular code to work with a modular JDK, using module path and classpath to interoperate with named modules, while preserving backward compatibility and module graphs.
Explore unnamed modules and modular code from the command line, learning to compile with the module path and add-modules flag, and to run a crawler jar with indexer and downloader.
Learn how non-modular jars become automatic modules on the module path and how explicit and automatic modules declare dependencies in JPMS migrations.
Explore how automatic modules integrate non-modular jars into a modular Java app using Jsoup to parse HTML, extract the title, and declare module dependencies.
Create lean custom runtime images with jlink by including only explicit java modules and application modules, enabling space efficiency for resource constrained devices and multi-service hosts.
Learn to build a self-contained custom runtime image with only explicit jpms modules, converting the Jsoup automatic module into an explicit module using a dependency analysis tool and module-info.java generation.
Use jdeps, a Java dependency analysis tool, to analyze jar files and modules, view dependencies at jar and package levels, and learn to use classpath, summary, and recursive options.
Convert a non-modular jar to an explicit modular jar by generating module-info.java, compiling with javac, inject it into the jar, and build a custom runtime image with jlink.
Learn how services in the Java platform module system decouple consumers from providers, enabling runtime provider switching and extensibility without recompilation.
Convert the downloader module into a consumer, decoupled from a new service module that provides a connect service and an http connect implementation, enabling runtime extensibility without recompilation.
In this lecture, we create a Service module called Connect.
In this lecture, we create a Service Provider module, which provides an implementation for the Service.
In this lecture, we create Consumer module, which would consume a Service. We will also see how ServiceLoader class is used for consuming a Service. The Downloader module that was created earlier is now implemented as Consumer in this lecture.
A very important lecture that clearly demonstrates how Module Resolution works in the context of Service and Service Providers and how the Module Graph is constructed. In this lecture, we will see the full workflow of the application in action as the main application class (Crawler) is implemented.
This lecture demonstrates creation of custom runtime image with the application modules, service module, and required platform modules and finally executes the application with the created image.
In this lecture, we will see Extensibility in action. We will create a new Service and we will simply rerun the application module from previous lecture, which was part of custom runtime image and the new service is just added to the module path, i.e., there is no compilation or redeploying - just restarting the application.
Recent Updates: Added a new section on JPMS Services, which help in creating completely decoupled services
This course provides an in-depth understanding of the Java Platform Module System (JPMS) and how it enables the creation of modular, strongly encapsulated, and space-optimized software that is extensible. JPMS is a major feature of Java 9, introduced as part of Project Jigsaw to address challenges faced by earlier versions of Java.
When building large, complex software, it is crucial that the code is easy to understand, maintain, secure, and extend. These are essential goals for any well-designed system. Prior to Java 9, achieving these goals relied heavily on design principles like Information Hiding, which utilized packages and access modifiers. However, in some cases, packages and access modifiers fell short, compromising these objectives. Java also faced significant issues with configuration (commonly referred to as JAR hell) and the tendency to ship as a monolithic library. JPMS resolves these limitations by introducing modules, a new layer of abstraction that ensures better encapsulation, more reliable configuration, and the ability to create space-optimized, extensible software.
In this course, we begin by exploring the problems JPMS was designed to solve, helping you understand its purpose clearly. Next, we’ll dive into the anatomy of a module and how to create them from both the command line and Eclipse. You’ll also learn how modular and non-modular code can interoperate. One of the most exciting features of JPMS is the ability to create custom runtime images (JREs) or smaller distributables, and in this course, you’ll learn exactly how to do that—an essential skill for every developer. Finally, we learn about JPMS Services. Considered the cornerstone of modular programming, JPMS Services enable our application to be extensible allowing us to add new services at runtime.
Each concept is thoroughly explained with realistic examples, clear illustrations, and practical demonstrations to ensure you grasp the material fully.