Command-line Interface
Explore how to integrate a command-line interface with a clean architecture Python project. Learn to connect use cases with repositories, handle user input, and display domain models, enhancing your system's modularity and external system interactions.
We'll cover the following...
So far, we’ve created the domain models, the serializers, the use cases, and the repository, but we’re still missing a system that glues everything together. This system has to get the call parameters from the user, initialize a use case with a repository, run the use case that fetches the domain models from the repository, and return them to the user. Let’s see now how the architecture we’ve just created can interact with an external system like a CLI (command-line interface). The power of clean architecture is that the external systems are pluggable, which means that we can defer the decision about the details of the system we want to use. In this case, we want to give the user an interface to query the system and get a list of the rooms ...