Use Cases

Let’s learn about the importance of use cases in clean architecture with some examples.

It’s time to implement the actual business logic that runs inside our application. Use cases are the places where this implementation happens, and they may or may not be directly linked to the external API of the system. The simplest use case we can create fetches all the rooms stored in the repository and returns them. In this first section, we won’t implement any filters to narrow our search. Instead, we’ll introduce code that utilizes filters in the next lesson, “Error Management in a Use Case,” where we’ll discuss error management.

Impact on our test case

Our repository is our storage component. Following the structure of clean architecture, this will be implemented into the external systems layer, which, as we mentioned earlier, is the outer layer. ...

Access this course and 1400+ top-rated courses and projects.