Single responsibility: placing an order

Split a class along its reasons to change, so each change touches one small piece.

Level Intermediate

What you will see

  1. One order, five jobs
  2. Prices and words in one loop
  3. One class per reason to change
  4. The orchestrator keeps the order
  5. When not to split

Before / after

Base: single-responsibility-base-tsView the diff

Exercises