## Metadata * URL: [https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/](https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/) * Published Date: 2008-07-29 * Author: [[jeffrey-palermo|Jeffrey Palermo]] ## Highlights * This architecture is not appropriate for small websites. It is appropriate for long-lived business applications as well as applications with complex behavior. * It emphasizes the use of interfaces for behavior contracts, and it forces the externalization of infrastructure. * The biggest offender (and most common) is the coupling of UI and business logic to data access. * Historically, the industry has modified data access techniques at least every three years; * all code can depend on layers more central, but code cannot depend on layers further out from the core. * The first layer around the Domain Model is typically where we would find interfaces that provide object saving and retrieving behavior, called repository interfaces. * Out on the edge, we would find a class that implements a repository interface. * Hexagonal architecture and Onion Architecture share the following premise: Externalize infrastructure and write adapter code so that the infrastructure does not become tightly coupled.