appendix-a

Appendix A. Guided Solutions

 

A.1 Chapter 1: Make a Mini-Defensible Decision

Because this mission asked you to use your own personal project, your specific answers will vary. However, here is a model example of what a successful, defensible "Decision Receipt" looks like for a very common, foundational scenario:

The Scenario: I was writing a script to read a list of user orders, calculate the tax, and print a receipt to the screen.

Option A: Put all the code into one single main file.

  • Pro: High "Speed to Ship." It is super fast to just open one file and start typing. I don't have to worry about figuring out how to import or export data between different files.
  • Con: Low Maintainability. It completely violates the "Separation of Concerns." If the file grows to 1,000 lines, finding a specific math bug amid the printing logic becomes a nightmare.

Option B: Split the code into three separate files (dataReader, taxCalculator, and receiptPrinter).

  • Pro: High Maintainability. Each file has exactly one job. If the math is wrong, I know exactly which file to open without looking at the printing code.
  • Con: Slower to set up initially. I have to write extra code just to link the files together and pass the data back and forth.

The Final Decision & Rationale:

A.2 Chapter 2: The Architect's Toolkit

A.3 Chapter 3: The Principles of Sound Structure

A.4 Chapter 4: Thinking in Layers

A.4.1 Model 1: The Simple Blog (Standard Complexity)

A.4.2 Model 2: The Banking System (High-Stakes Complexity)

A.4.3 The Architect’s Analysis

A.5 Chapter 5: Hexagonal Architecture

A.5.1 The "Airlock" Refactor: Crypto Tracker

A.5.2 Wiring It Up (The Composition Root)

A.6 Chapter 8: The Database as an Architectural Pillar

A.6.1 The Polyglot Blueprint

A.6.2 The Audit: Is your Pillar solid?

A.7 Chapter 9: Architecting for the Cloud

A.8 Chapter 10: Architecting for Resilience and Scale

A.8.1 1. The Escape Hatch (Timeouts)

A.8.2 2. The Second Chance (Retries & Backoff)

A.8.3 3. The Fire Alarm (The Circuit Breaker)

A.8.4 4. The Plan B (The Fallback)