When I started learning Spring, I noticed something about many of the tutorials I found.
They often showed how to use a feature, but not always why it worked or how different parts of an application fit together.
I learn best by building things and documenting what I discover, so I started Spring by Example V2.
The idea is simple: instead of building one large application, Iโm creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.
Iโm happy to say that Iโve now completed Module 04 - Spring Modulith. ๐
This module helped me explore modular monolith architecture and understand how Spring Modulith supports the development of well-structured Spring applications.
The module covers:
- Application Modules
- Module Boundaries
- Module Dependencies
- Application Events
- Event Externalization
- Module Verification
- Module Documentation
- Module Testing
One thing I enjoyed about this module was learning how to organize an application into modules with clear responsibilities instead of allowing everything to become tightly coupled.
Module boundaries help define which parts of an application belong together and how they interact. Spring Modulith also provides tools for verifying module structure and detecting unwanted dependencies.
Application events introduced another useful concept: components can communicate through events without needing to depend directly on the components that handle them.
I also explored module verification, documentation, and testing, which help make modular architecture more than just a package-organization decision.
The goal isnโt simply to create separate packages. Itโs to understand how to establish meaningful boundaries, manage dependencies, and keep an application maintainable as it grows.
The project is open source, and Iโm continuing to build it as I learn:
๐ GitHub: https://gith.ub/dsAQrAU5
๐ GitLab: https://gitl.ab/gfDEyGH3
Thereโs still a long way to go, but completing Module 04 โ Spring Modulith feels like another important milestone. ๐
Next up: Module 05 - Spring Testing, where Iโll explore the Spring TestContext Framework, @SpringJUnitConfig, @SpringBootTest, test slices, MockMvc, integration testing, and more.
One focused example at a time. ๐
If youโve worked with Spring Modulith before, what has helped you most when designing modular Spring applications?
Top comments (0)