appendix-a
Appendix A. Guided Solutions
A.1 Chapter 1: Make a Mini-Defensible Decision
Analyzing a technical decision by articulating tradeoffs transforms a gut feeling into a defensible choice.
Mission Objective: Document a defensible "Decision Receipt" for localized order-processing logic, balancing short-term execution speed against long-term maintainability.
Table A.1 Making a Mini-Defensible Decision
|
Decision Element
|
Model Solution Output
|
|
Context and Goal
|
Balance short-term execution speed with long-term maintainability for order-processing logic.
|
|
Option A (Monolithic)
|
Put all code into a single main file.
•
Pro: High speed to ship; zero module import overhead.
•
Con: Low Maintainability. Violates Separation of Concerns; difficult to debug as codebase grows.
|
|
Option B (Modular)
|
Split into three focused files:
dataReader,
taxCalculator, and
receiptPrinter.
•
Pro:
High maintainability; tax math is strictly isolated.
• Con: Minor initial setup overhead to pass data between files.
|
|
Decision and Rationale
|
Proceed with Option B. Isolating the tax calculation logic prevents upcoming discount feature requests from unintentionally introducing bugs into the receipt printing code.
|
A.1.1 Architect's Analysis
Evaluating local script refactoring through an architectural lens highlights two foundational principles that govern component isolation: