Dissecting function-level nano architecture
In Chapter 2, Defining Boundaries and Letting Go, we introduced the concept of nano (that is, function-level) hexagonal architecture. This architecture level describes how we create a clean structure within a given function so that all internal dependencies are acyclic, and we decouple the business logic from external dependencies. To accomplish this, we put some simple layering in place as shown in the following diagram.
Akin to Alistair Cockburn's Hexagonal Architecture and Robert Martin's Clean Architecture, we want to isolate the business logic from the concerns of interacting with the technical resources, such as the datastore and event hub and the function execution environment. Therefore, we implement the business logic in Model classes, wrap all resource calls in Connector classes and hide the details of the execution environment in the Handlers. This does more than make the code...