Problem decomposition
Problem decomposition is the practice of dividing a large task into smaller parts. Each part should have a clear responsibility, inputs, outputs, and failure behavior.
Use the event behavior from Pseudocode as the starting point. The help desk workflow is easier to reason about when each decision has one job:
- Validate the incoming event.
- Accept the ticket.
- Return a result that explains what happened.
The list is intentionally small. Duplicate detection, storage, and assignment are not implementation details of validation; they are new responsibilities that we can add when the case study requires them.
Useful questions
- What is the smallest meaningful responsibility here?
- What information does this part need?
- What result does it produce?
- What should happen when the input is invalid?
- Can this part be named without explaining its implementation?
The responsibilities become easier to express in code when each one has a focused interface.