Component organization and boundaries
As we saw in Figure 7.2, our application composition establishes a clear structure where each component has specific responsibilities. At the edges of this system, framework adapters must handle the transformation of data between external frameworks and our Clean Architecture while coordinating user interactions.
Looking at Figure 7.4, we can see that our CLI adapter sits at a crucial architectural boundary. We’ve chosen Click, a popular Python framework for building command-line interfaces, for our CLI implementation. The adapter must translate between Click’s framework-specific patterns and our application’s clean interfaces, managing both user input and the display of results.
Let’s examine the core adapter structure:
class ClickCli:
def __init__(self, app: Application):
self.app = app
...