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?







