About

A better way to develop software: Modularity with DDD and the JPMS

Why do I think modularity with domain driven design (DDD) leads to better software? Most of us probably have drawn a domain model while designing a new software system. Domain models are an important artifact in the once pretty popular rational unified process (RUP) after all. It helps us understand the system we are going to build.

However, DDD goes one step further by defining the building blocks of a domain model in the form of concepts and patterns. One of these concepts is developing a ubiquitous language for the domain model and using it through the code. This language helps us to communicate with each other and the people that know the domain.

Another important pattern in DDD is Aggregates. They advocate high cohesion and low coupling. These properties have been promoted by many famous software engineers for a long time now. By implementing aggregates as modules using the Java Platform Module System (JPMS), we can structure our code very cleanly.

Where was it invented?

Personally, I think many advanced software engineers do apply modularity and DDD concepts but without naming them this way. Below are quotes of some more or less famous advocates of DDD and modularity (emphasis added by me).

The key to controlling complexity is a good domain model, a model that goes beyond a surface vision of a domain by introducing an underlying structure, which gives the software developers the leverage they need. A good domain model can be incredibly valuable, but it’s not something that’s easy to make.”

― Martin Fowler

“To communicate effectively, the code must be based on the same language used to write the requirements—the same language that the developers speak with each other and with domain experts.”

― Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software

“Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control.

― Grady Booch author of Object-Oriented Analysis and Design with Applications

“Clean code is focused. Each function, each class, each module exposes a single-minded attitude that remains entirely undistracted, and unpolluted, by the surrounding details.”

― Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship

“We need to focus on modularity to ensure a consistent architecture story is told. It is the glue that binds. It’s the piece that helps bridge low-level class design with higher-level service design.”

― Kirk Knoernschild, Java Application Architecture: Modularity Patterns with Examples Using OSGi

“When you write a software module, you want to make sure that when changes are requested, those changes can only originate from a single person, or rather, a single tightly coupled group of people representing a single narrowly defined business function.”

― Robert C. Martin

Get in touch

If you have any software related project and need some support, please contact my company Opus Software AG or drop me a note.

I’m going to post a new article about modularity and DDD about every second week. If you would like to get notified, please subscribe to the mail list.

More from blog.opus.ch?

Opus Software AG
Unterer Graben 1
8400 Winterthur
www.opus.ch

Tel. +41 44 934 44 33
michi.hausheer@opus.ch