9 Migration and modularization strategies

 

This chapter covers

  • Preparing a migration to Java 9 and beyond
  • Continually integrating changes
  • Incrementally modularizing projects
  • Generating module declarations with JDeps
  • Hacking third-party JARs with the jar tool
  • Publishing modular JARs for Java 8 and older

Chapters 6, 7, and 8 discuss the technical details behind migrating to Java 9+ and turning an existing code base into a modular one. This chapter takes a broader view and looks at how to best compose these details into successful migration and modularization efforts. We’ll first discuss how to perform a gradual migration that cooperates well with the development process, particularly build tools and continuous integration. Next, we’ll look at how to use the unnamed module and automatic modules as building blocks for specific modularization strategies. And finally, we’ll cover options for making JARs modular—yours or your dependencies’. When you’re done with this chapter, you’ll not only understand the mechanisms behind migration challenges and modularization features—you’ll also know how to best employ them in your efforts.

9.1 Migration strategies

9.1.1 Preparatory updates

9.1.2 Estimating the effort

9.1.3 Continuously build on Java 9+

9.1.4 Thoughts on command-line options

9.2 Modularization strategies

9.2.1 Bottom-up modularization: If all project dependencies are modular

9.2.2 Top-down modularization: If an application can’t wait for its dependencies

9.2.3 Inside-out modularization: If a project is in the middle of the stack

9.2.4 Applying these strategies within a project

9.3 Making JARs modular

9.3.1 Open modules as an intermediate step

9.3.2 Generating module declarations with JDeps

9.3.3 Hacking third-party JARs

9.3.4 Publishing modular JARs for Java 8 and older

Summary

sitemap