Benoit B. Mandelbrot referred to himself as a “fractalist” and is recognized for his contribution to the field of fractal geometry, which included

The Mandelbrot nature of modularization | Programming Chi - Tomasz Fijałkowski’s blog

submited by
Style Pass
2024-04-24 21:30:06

Benoit B. Mandelbrot referred to himself as a “fractalist” and is recognized for his contribution to the field of fractal geometry, which included coining the word “fractal”, as well as developing a theory of “roughness and self-similarity” in nature.

In the world of software, modularization is crucial for maintaining flexibility, scalability, and code readability. I have participated in many discussions about the ideal size of a module. These discussions often feature extreme opinions, ranging from “it’s better to have a few large modules” to “the smaller the modules, the better”. The truth, as always, lies somewhere in between, and in this post, I will point out how to pinpoint it.

In the world of software engineering, a module does not have a clear-cut definition. For some, modules may be microservices, for others, JAR files or packages, and for yet others, Maven modules or Gradle subprojects. This diversity in definitions complicates discussions about modularization.

For the purposes of this article, I will adopt a broad definition of a module as a logical unit of code within a program or library, having both an interface and an implementation. The simple concept is illustrated in the image below.

Leave a Comment