Core concepts retrieval review
An attempt-first review of layers, persistence, API boundaries, transactions, security, and tests.
Assumes you know
After this you should be able to
- Explain a layered request path
- Predict persistence and transaction behavior
- Defend an API boundary decision
Core concepts · retrieval review
Retrieve decisions, predict consequences, and debug the seams before reading the answer structures.
Attempt first#
- A controller directly calls
JpaRepositoryand calculates a discount. What becomes harder to test, reuse, and change? Sketch the corrected dependency direction. - Predict what changes when a managed entity is mutated inside a transaction but no explicit
saveappears. Which assumption would you verify rather than state as a rule? - A client should never choose a task owner, but your request DTO contains
ownerId. Diagnose the boundary leak and state where the owner should come from. - A service creates a project, then fails while adding the first task. Place the transaction boundary and explain the visible result if it is missing.
- Choose between a unit test with a mock and a web slice test for a validation failure. What is each test proving?
- A logged-in user receives 403 for a private route. Predict the difference between “not authenticated” and “authenticated but not authorized,” then name the evidence you would inspect.
Completion evidence#
Draw one request from controller to database and back, marking its DTO boundary and transaction. Then explain your drawing to another person or record a two-minute answer.
Current status: Not started
Open answer structures after your attempt
Use a stable chain: controller translates HTTP; service owns use-case rules and transaction decisions; repository owns persistence access. A DTO makes the API contract intentional, while identity should come from authenticated context. Explain test choice by the boundary under test, not by which annotation is fashionable. For security failures, separate credentials from granted authority before changing code.