A Use Case in a Nutshell

Let's look at a use case to guide us on what we need to build.

We'll cover the following...

First, let’s discuss what a use case actually does. Usually, it follows these steps:

  1. Take input.
  2. Validate business rules.
  3. Manipulate model state.
  4. Return output.

A use case takes input from an incoming adapter. You might wonder why this step was not called “Validate input”. The answer is that use case code should care about the domain logic, and we shouldn’t pollute it ...