Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hexagonal Architecture

Hexagonal Architecture

Victor Martinez

June 30, 2022
Tweet

More Decks by Victor Martinez

Other Decks in Programming

Transcript

  1. • INTRODUCTION AND THEORETICAL BACKGROUND (20min) • SHOW ME THE

    CODE (20min) • QUESTIONS (5min) TOTAL = 45min AGENDA
  2. HEXAGONAL ARCHITECTURE Allow an application to equally be driven by

    users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases. Alistair Cockburn 2005, Ports and Adapters
  3. HEXAGONAL ARCHITECTURE Allow an application to equally be driven by

    users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases. Alistair Cockburn 2005, Ports and Adapters Hexagonal Architecture OR Hexagonal Design?
  4. "Atividades relacionadas a arquitetura de software são sempre de design.

    Entretanto, nem todas atividade de design são sobre arquitetura. O objetivo primário da arquitetura de software é garantir que os atributos de qualidade, restrições de alto nível e os objetivos do negócio, sejam atendidos pelo sistema. Qualquer decisão de design que não tenha relação com este objetivo não é arquitetural. Todas as decisões de design para um componente que não sejam “visíveis” fora dele, geralmente, também não são."- Elemar Jr. https://eximia.co/quais-sao-as-diferencas-entre-arquitetura-e-design-de-software/
  5. LET'S DIVE INTO PORTS & ADAPTERS Photo by Brina Blum

    PORT ADAPTER INTERFACES & IMPLEMENTATIONS
  6. DEPENDENCY INVERSION PRINCIPLE "High level modules should not depend on

    low level modules; both should depend on abstractions. Abstractions should not depend on details. Details should depend upon abstractions."
  7. DEPENDENCY INVERSION PRINCIPLE "High level modules should not depend on

    low level modules; both should depend on abstractions. Abstractions should not depend on details. Details should depend upon abstractions." DEPEND ON ABSTRACTIONS, NOT DETAILS.
  8. DOMAIN PORT PORT PORT PORT PORT PORT ADAPTER ADAPTER ADAPTER

    ADAPTER ADAPTER ADAPTER API DATABASE MESSAGE BROKER AUTH UI NOTIFICATION ANATOMY
  9. CREATE CONTRACT DATA PORT ADAPTER REST API DB PORT ADAPTER

    POSTGRES DATABASE STORAGE PORT ANATOMY
  10. CREATE CONTRACT DATA PORT ADAPTER REST API DB PORT ADAPTER

    POSTGRES DATABASE STORAGE PORT ADAPTER S3 STORAGE ANATOMY
  11. DOMAIN PORT PORT PORT PORT PORT PORT ADAPTER ADAPTER ADAPTER

    ADAPTER ADAPTER ADAPTER API DATABASE MESSAGE BROKER AUTH UI NOTIFICATION WHAT IF WE NEED TO CHANGE THE ADAPTER?
  12. WHAT IF WE NEED TO CHANGE THE ADAPTER? DOMAIN PORT

    PORT PORT PORT PORT PORT A A A A A FLASK POSTGRES RABBITMQ … SNS A PUBSUB A SQS A REDIS A MONGODB A FIREBASE A A FALCON APPLE A HUG A A A A A … … … … …
  13. IT'S ALL ABOUT S O L I D Figure: Pereira,

    Matheus. "Capitals of classical antiquity: Understand the difference between the 5 orders" ArchDaily, May 2018, www.archdaily.com/892595/capitals-of-classical-antiquity-understand-the-difference-between-the-5-orders. Accessed 1 June, 2022.
  14. "TALK IS CHEAP. SHOW ME THE CODE." - LINUS TORVALDS

    https://github.com/victormartinez/ flask-hexagonal