Keep one responder on duty
Related business-invariant practice. Module imports and dependency inversion are checked locally in the lesson exercise, not by the practice canvas.
Open challenge →Compare three ways to protect business rules through inward-facing source dependencies.
A domain rule needs a database driver and a web framework just to run a unit test.
Long-lived business logic benefits from stable boundaries around replaceable transport and persistence details.
Adapters depend on core-owned ports, while domain rules remain independent of transport and storage details.
Every green arrow is a source-code dependency, not runtime request direction.
Select a component, or focus it and press Enter, to read its role.
Select a step to highlight its participants. This conceptual walkthrough is separate from challenge scoring.
Arrows show source-code imports toward the core, not runtime request flow. The storage adapter depends on a core-owned port.
Transport adapts a request to a use case. Its source code imports the inward-facing application contract.
| Approach | Emphasis | Boundary contract |
|---|---|---|
| Clean | Entities and use cases with boundaries around interface adapters and frameworks. | Define boundary contracts on the side that owns the business policy. |
| Hexagonal | Ports represent application interactions; adapters connect UI, storage, tests and other devices. | Keep the application usable through a port while swapping the outside adapter. |
| Onion | An independent domain model at the center, surrounded by application behavior and infrastructure. | Inner layers define interfaces and outer layers implement them. |
The initial use-case module imports concrete storage. Select the imports that keep the required boundary contracts while pointing toward the core. Compare your choices with the source-import diagram above.
This local exercise checks the declared import graph. It awards no points and makes no claim about runtime behavior, framework integration or service capacity. Reloading resets it.
Who owns a persistence port, and how can a runtime call reach an adapter while the source dependency points inward?
Use Plan & estimate inside practice to record your assumptions and trade-offs.
These links open the original challenges. Existing round unlocks, completions and points apply.
Related business-invariant practice. Module imports and dependency inversion are checked locally in the lesson exercise, not by the practice canvas.
Open challenge →Robert C. Martin · Clean Architecture ↗
Alistair Cockburn · Hexagonal architecture ↗
Jeffrey Palermo · Onion Architecture ↗
Original PractiseGrid explanations and conceptual diagrams, with primary references for further study. Dedicated scored exercises can be added as coverage grows.