Skip to content

Modular Java Architectures

Andrew Serff edited this page Nov 22, 2015 · 1 revision

HOME > [NFJS 2015](NFJS 2015) > [Modular Java Architectures](Modular Java Architectures)

Kirk Konernschild

Modularity is coming to the Java Platform in Java 9.

OpenJDK is developing Jigsaw which will become part of Java 9.

OSGi Exists today.

Jigsaw has been in development since 2007. They are also modularizing the JDK along with this which is why it has taken them so long. He isn't going to talk about any of this today....

###Module We have only treated a jar file as a packaging construct. What happens if we treat a jar file a more than that? treat them as modules.

###Benefits of Modularity Design:

  • Reuse
  • Extensibility
  • Adapaptability
  • Maintainability
  • Understandability
  • Minimize complexity

Runtime:

  • Module lifecycle
  • Manageability
  • Hot deployment
  • I missed the rest

###Base patterns

  • Manage Relationships - Design Module relationships
  • Module Reuse - Emphasize reuseablility
  • Cohesive Modules - Module behavior should serve a singlar purpose

###Dependency Patterns

  • Acyclic Relationships
  • Levelize Modules
  • Physical Layers - don't voiliate the layers
  • Container Independence - modules should be independent of the runtime container
  • Independent Deployment

Defining a system

Interfaces should be close to the classes that use them, farther away from the classes that implement them.

The main theme in this talk is to think about how you are designing your Java classes and methods. Think about what passing domain objects between classes does to adding dependencies. Abstract classes, move interfaces away from implementation. Look at the way you package your classes as modules and understand the dependencies between them.

Clone this wiki locally