Loading lesson…
Level 1 · Apprentice0 XP
Point every import inward so the business rules never know about the database or the framework.
Step 1 / 6
ProblemA use case that imports the ORM and the HTTP request cannot be tested without a database and a server. Changing the database means rewriting business rules.
← → step
Before this: Layered architecture and its limits
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write a use case CancelOrder that depends on a port OrderRepository (find, save). Test it with an in-memory fake: cancelling a shipped order must fail, cancelling a new one must save it as cancelled. No database, no framework.