Summary

In this chapter, we've looked at some guidelines and best practices to create modules and identify module boundaries. When creating a new application or when migrating an existing legacy application to Java modules, it's always a good idea to have a map of the modules and their interactions designed in advance. We've looked at some best practices that let you figure out what a module should be made of and what would cause you to segregate logic into separate modules.

We then looked at a list of best practices and ideas to use in your code. Many of the best practices discussed previously come with simplified code examples. Each example is intentionally bare-bone with code that demonstrates just the pattern being discussed and little else, so that you can easily pick any of them up and tweak them further or apply them in your own code.

Now that we have these patterns in your tool belt, let's tackle a major challenge that Java developers will face when moving to Java 9, migration of existing code. There have been years and years of Java development and tons of legacy code of various complexities that has been built using earlier versions of Java. How do we approach moving them to take advantage of Java modules? Before that, would they even work with Java 9? Let's begin to answer those questions, as well as understand what it takes to get your code read for such a migration in the next chapter.

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

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