Free practice · ordering · medium

Practice

Decompose a small program

Arrange the decomposition of a small workplace automation.

Solution architecture

Focused responsibilities create visible data boundaries

Responsibility
One reason for each unit to change
Naming
Business meaning visible at call sites
Scope
Local state by default
Interface
Explicit parameters and returned values
Side effects
Confined to a narrow boundary

A reviewable beginner program separates validation, calculation, formatting, and side effects through explicit parameters and returned values.

Arrange in the correct order
  1. 1. Connect the units and test the complete workflow
  2. 2. Define values passed into and returned from each unit
  3. 3. Assign one focused responsibility to each unit
  4. 4. Identify validation, calculation, formatting, and delivery stages
  5. 5. State inputs, output, rules, and acceptance checks