36.5 Module-Dependency Graphs: A Deeper Look

Previously, we’ve shown two module-dependency graphs. Here we continue our discussion of module graphs and show the errors that occur if a module directly or indirectly requires itself—known as a cycle.

36.5.1 java.sql

Figure 36.16 shows the module-dependency graph for a module named modulegraphtest that depends on the java.sql module, per the following module declaration:


module modulegraphtest {
 requires java.sql;
}

Fig. 36.16 Dependency graph for a module that depends on java.sql.

A module dependency graph depicts five blocks. The blocks are as follows. Module graph test, java period s q l, java period x m l, java period logging and java period base.

NetBeans highlights the module declared by the module declaration (modulegraphtest ...

Get Java How to Program, Early Objects, 11th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.