FOCUS Architecture — Front-Matter: Front matter
- Source: /library/FOCUS Architecture/source-file.pdf
- PDF pages: 1–12
- Pages without text: 1
FOCUS: Architecture for People
Who Ship Software
J.C. Ködel
FOCUS: Architecture for People
Who Ship Software
- About the Author
- The F12 test
- The price of too many layers
- The price of too few layers
- Four pieces
- Why now
- Who looks for the rule now
- Rosie’s Coffee Shop
- Quick reference
- Map of the trilogy
- What each volume answers
- Where this book fits
- The Day One Line Change Broke Three Screens
- The screen that started out reasonable
- Coupling
- Cohesion, the other side of the coin
- The axis of change
- Pitfalls
- Quick reference
- Exercises
- AI Writes Fast. So What?
- The twelve-minute coupon
- The GitClear yardstick
- Why the generator fails this way
- Three guardrails against the same bug
- So is AI the problem?
- Pitfalls
- Quick reference
- Exercises
- Simplicity Is a Decision: KISS and YAGNI
- The engine nobody asked for
- The four costs
- Where the acronyms came from
- The six lines the menu asks for
- What YAGNI doesn’t cut
- And when the need finally arrives?
- Pitfalls
- Quick reference
- Exercises
- DRY Isn’t About Code
- Extraction by reflex
- What Hunt and Thomas actually wrote
- The inverse case: the card reader fee
- Timing tools
- The same knowledge outside the code
- The critique: DRY as a coupling factory
- Pitfalls
- Quick reference
- Exercises
- SOLID Without Dogma
- One tab, four bosses
- Slice by actor, not by verb
- Read the code through the OCP and LSP lenses
- Narrow the contract and flip the arrow
- What each principle charges whoever is looking
- The cost of carrying what doesn’t matter
- How many things you hold at once
- The critique SOLID earned
- Pitfalls
- Quick reference
- Exercises
- Pure Functions and Immutability
- Two totals for the same tab
- Purity is what a function doesn’t do
- Swap the call for the returned value
- Freeze the data: immutability across ten languages
- Functional core, imperative shell
- Pitfalls
- Quick reference
- Exercises
- Errors Are Values
- The payment that only said “Something went wrong”
- Expected error is not a defect
- The failure becomes part of the return type
- Three steps, two rails
- Go’s counterpoint
- Exceptions only at the boundary
- Pitfalls
- Quick reference
- Exercises
- Explicit Dependencies: DI and the Composition Root
- The payment that fetched its own dependencies
- Dependencies move up to the constructor
- If nobody calls the locator, who builds the graph?
- Pure DI before any container
- The Python counterpoint: discipline instead of syntax
- DI for the boundary, data for the rest
- Pitfalls
- Quick reference
- Exercises
- FOCUS in One Page
- The handler that did everything
- The path of a tap
- The four pieces in the same gesture
- The same slice in your language
- Why just four
- The recipe the orchestrator follows
- Pitfalls
- Quick reference
- Exercises
- Features, Not Layers
- The change that touched four folders
- The axis of change
- The coffee shop in slices
- Why it isn’t four folders
- The whole slice at once
- What the imports give away
- The same slice in ten languages
- shared/ is born empty
- Pitfalls
- Quick reference
- Exercises
- The View: Dumb by Design
- The screen that calculates
- The state that arrives ready
- The same screen, now dumb
- Does this belong in the View?
- The critique: bloated state
- Pitfalls
- Quick reference
- Exercises
- The Orchestrator: Event In, State Out
- Where the one-way flow came from
- The anti-solution: the orchestrator that decides
- Events and states as sealed classes
- The complete orchestrator
- Go’s counterpoint: no unions, no billing
- The flow test: event on top, states below
- Transient context and persistent context
- The criticism: boilerplate and rules in the reducer
- Pitfalls
- Quick reference
- Exercises
- Use Cases: Where the Rules Live
- The anti-solution: the same rule in three places
- The rule as a pure function: the signature first
- The same rule, ten languages
- Orchestrator fetches, use case decides
- The use case as a retrieval unit
- Testing without a single test double
- The critique: “where’s the use case’s interface?”
- Pitfalls
- Quick reference
- Exercises
- Repositories: The Exception Boundary
- The anti-solution: the copied catch in every screen
- The repository’s contract comes before its body
- The single translation: one catch, and only one
- The lookup feeding the orchestrator
- The same boundary in ten languages
- Where reading can stop
- Contracts that age slowly
- The critique: the generic repository and “the ORM already
does this”
- Preview of the fake: the interface you’ll thank in chapter 17
- Pitfalls
- Quick reference
- Exercises
- Commands and Queries: CQS Without Ceremony
- The anti-solution: paying and asking in the same gesture
- CQS: Meyer’s rule
- The split, in all ten languages
- The canonical table’s two tracks
- From CQS to CQRS, and where FOCUS stops
- Classify the eight operations
- Pitfalls
- Quick reference
- Exercises
- Test Each Piece the Way It Asks to Be Tested
- The anti-solution: the suite that asserts the how
- Use case: a pure test, no double at all
- Repository: the fake you already have
- Orchestrator: flow test
- View and integration: where each one pays its own cost
- The two critiques
- Pitfalls
- Quick reference
- Exercises
- What to Do When the Language Doesn’t Help
- The slice on the board
- Types first: four families and one warning
- The three anchors, family by family
- When the language doesn’t help
- The critiques, with a ruler instead of rhetoric
- The equivalence table: porting to the 11th language
- Pitfalls
- Quick reference
- Exercises
- Anti-Patterns: How to Wreck FOCUS
- The shape of the card
- Card 1: business rule in the orchestrator
- Card 2: use case that hits the database
- Card 3: generic repository
- Card 4: layer by ceremony
- Card 5: domain try/catch
- Card 6: premature shared/
- What Go won’t let you do
- Pitfalls
- Quick reference
- Exercises
- Migrate Legacy Code Without Stopping the Factory
- The fig that strangles
- Choose the first slice: frequency times pain
- Step 1: fence the behavior with a characterization test
- Step 2: extract the rule into a pure use case
- Step 3: wrap the legacy in an adapter
- Step 4: wire the new view to the orchestrator
- When NOT to migrate
- Both worlds on the same counter
- Pitfalls
- Quick reference
- Exercises
- FOCUS + AI: The Duo That Scales
- The one-sentence request
- Each piece against a number
- The spec says what, the architecture says where
- Anatomy of the architectural prompt
- The same feature under the prompt
- Slice-guided review
- Two criticisms I take seriously
- Pitfalls
- Quick reference
- Exercises
- Architecture for humans and for models
- The pattern nobody designed on purpose
- The name for this
- The question left over
- Build Rosie’s App
- The focus-coffee repository
- Menu: the read-only slice
- Tab: the slice with a lifecycle
- Payment: the slice of errors
- Loyalty: the rule, and the first shared/
- Porting roadmap
- The critique: “book examples always work”
- Pitfalls
- Quick reference
- Exercises
- Ship Increments Without Chaos
- FOCUS in a hallway conversation
- Who benefits (and it’s a single reason)
- The ruler against drift
- Quick reference
- Exercises