0PricingLogin
Clean Architecture & Design Patterns in Practice · Lesson

Implementing Use Cases (Interactors)

Develop Use Cases that orchestrate Entities to achieve specific application features, embodying application-specific business rules.

What are Use Cases (Interactors)?

In Clean Architecture, Use Cases (sometimes called Interactors) are at the heart of your application's logic. They represent the specific tasks or features your application can perform.

Think of them as the orchestrators of your core business entities. They define how your application uses those entities to achieve a goal, like 'create a new user' or 'process an order'.

Role of Use Cases in Clean Architecture

Use Cases sit in the 'Use Cases' layer, just outside the 'Entities' layer. This means:

  • They depend on Entities.
  • They do NOT depend on external layers like the UI, databases, or web frameworks.

Their main job is to coordinate the flow of data to and from the Entities and direct the Entities to perform their specific business rules.

All lessons in this course

  1. Designing Business Entities
  2. Implementing Use Cases (Interactors)
  3. Input and Output Ports
  4. Enforcing Business Rules with Invariants
← Back to Clean Architecture & Design Patterns in Practice