Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Mahan Hashemizadeh’s 2017 Spring Boot tutorial, “Remembering Clean Architecture” is a practical refactoring plan: decide the architecture first, keep use cases independent of frameworks, and make web, database, and configuration code depend inward on the core. Its module layout is one way to make those boundaries visible—not a universal template.

What Clean Architecture means in this Spring Boot example

Clean Architecture separates an application’s policies—what it does—from mechanisms such as HTTP, persistence, and framework wiring. The key constraint is the direction of source-code dependencies, not the number or names of modules.

Robert C. Martin states the Dependency Rule as: “Source code dependencies must point only inward, toward higher-level policies.” Inner circles should not know the names or data formats declared by outer circles. In practice, a use case can define an interface it needs; an outer implementation can depend on that interface and supply the mechanism.

Hashemizadeh’s tutorial applies this idea to a Spring Boot refactoring in which the team first agrees on architecture, then selects language and framework details. The framework is a delivery and implementation choice, not the definition of the application’s core.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the tutorial divides the application

The example uses modules to give responsibilities and dependency boundaries a visible home:

Module Responsibility Dependency relationship
Core Application use cases and boundary interfaces. Has no dependency on the other modules; its code is framework agnostic.
Data Repositories that retrieve or edit database data. Depends on core and implements its outbound boundary interfaces.
Web REST controllers that expose the application over HTTP. Depends on adapter rather than directly on core.
Adapter Translates communication between the web side and core. Depends on core and avoids framework knowledge where possible.
Configuration Spring Boot main application, configuration files, and resources. Composes adapter, core, data, and web.
Integration-test A separate home for tests identified as integration tests during refactoring. Not stated in the tutorial’s module summary.

This is a particular project layout, not a required Clean Architecture naming convention. The important question is whether the code dependencies preserve the boundary: the core should not import Spring MVC, database entities, or outer-module types merely because those are convenient.

How requests and data cross the boundaries

For a web request, the controller belongs at the HTTP edge. In this design it communicates through the adapter, which translates between web concerns and the core’s use-case boundary. This avoids making a REST controller the use case itself or allowing HTTP-specific types to become core policy.

For persistence, the direction is inverted. A core boundary describes what the application needs from an outbound operation; the data module implements that boundary using database access. The implementation depends on the core-defined contract, rather than the core depending on a repository framework or database representation.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configuration is the composition point: it brings the modules together and supplies concrete mechanisms. This keeps framework setup at the edge while allowing the application’s use-case logic to remain independent.

What to preserve during a refactor

  1. Agree on the architecture before choosing implementation details. Identify the application’s important policies, external mechanisms, and boundary contracts first.
  2. Move use cases and their boundary interfaces into the core. Check imports and build dependencies so core code has no dependency on the other modules or Spring-specific mechanisms.
  3. Place external implementations at the edge. Keep database repositories in data, REST controllers in web, and translation between the web interface and use cases in adapter.
  4. Centralize application composition. Let configuration assemble the concrete modules rather than making the core construct framework or infrastructure objects.
  5. Give integration tests a deliberate location. The tutorial moved tests recognized as integration tests into a separate integration-test module during refactoring; their distinct setup and infrastructure needs can then be made explicit.

Is this structure worth the extra modules?

It can be useful when a codebase has blurred application policy with web or database mechanisms, or when multiple developers need clear ownership boundaries. Modules can make forbidden dependencies harder to introduce and make the core easier to exercise without starting the full framework stack.

The cost is real: more module boundaries, contracts, wiring, and translation code. For a small application with few mechanisms and no meaningful dependency tangles, this structure can become ceremony. The tutorial offers a practical refactoring pattern, not measured evidence that the structure automatically improves productivity, defect rates, or maintenance.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How it relates to layered, hexagonal, and onion architecture

These architecture styles overlap in their effort to isolate application or domain logic from infrastructure. Labels alone do not guarantee clean dependencies; inspect the actual import and build graph.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Question What to examine
Dependency direction Do web and persistence mechanisms depend on application policies, or does the core import them?
Framework knowledge Can use cases run without Spring or database framework types in their interfaces?
Interface placement Are the contracts needed by core behavior owned by the inner policy, with outer code implementing them?
Test isolation Can core behavior be tested without bringing up infrastructure, while integration tests exercise the assembled system?
Composition cost Does the additional module and wiring structure solve a current problem, or mostly add indirection?

Further reading

Hashemizadeh’s original article is “Remembering Clean Architecture” on DZone. For the underlying principle, see Robert C. Martin’s InformIT excerpt on Clean Architecture, which describes the concentric-circle model and Dependency Rule.

Martin’s book, Clean Architecture: A Craftsman’s Guide to Software Structure and Design, is a 2017 first edition. Pearson lists ISBN-13 9780134494166; the publication’s paperback listing describes a 432-page book dated September 20, 2017. See Pearson’s title page and Amazon’s paperback listing for edition and format details.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.