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

Q&A - Clean Architecture - MeuAcerto

Q&A - Clean Architecture - MeuAcerto

Ivan Paulovich

September 03, 2020
Tweet

More Decks by Ivan Paulovich

Other Decks in Programming

Transcript

  1. Agenda • Hexagonal Architecture Style • Dependency Inversion Principle •

    Ports and Adapters Pattern • Test-Driven Design Development (Practices) • Clean Architecture Style • Principles, Patterns and Practices. • Walkthrough an Use Case • Q&A @ivanpaulovich
  2. Dependency Inversion Principle (DIP) • High-level modules should not depend

    on low-level modules. Both should depend on abstractions. • Abstractions should not depend on details. • Details should depend on abstractions. @ivanpaulovich
  3. Business @ivanpaulovich 5 Ports and Adapters Cloud 
 Messaging UI

    In Memory 
 Persistence 
 Tests In Memory 
 Messaging 
 SQL
  4. Business @ivanpaulovich 6 Ports and Adapters Cloud 
 Messaging UI

    In Memory 
 Persistence 
 Tests In Memory 
 Messaging 
 SQL Ports
  5. Business v @ivanpaulovich 8 Ports and Adapters Cloud 
 Messaging

    UI In Memory 
 Persistence 
 Tests In Memory 
 Messaging 
 SQL Adapters
  6. Test-Driven Development (Practices) Deposit 
 Use Case Customer 
 Repository

    Account Repository Test Expectations @ivanpaulovich
  7. Clean Architecture Style Hexagonal Architecture Style Ports and Adapters Pattern

    Dependency Inversion
 Principle Test-Driven Development Object-Oriented Design
 Principles Use Cases as Central Organizing Structure Pluggable User Interface @ivanpaulovich
  8. Principles • SOLID Principles. • Package Cohesion Principles: • The

    Release Reuse Equivalency Principle. • The Common Closure Principle. • The Common Reuse Principle. • Coupling Packages Principles: • The Acyclic Dependencies Principle. • The Stable Dependencies Principle. • The Stable Abstractions Principle.
  9. Entities Entities Clean Architecture Entities Use Cases Controllers Gatew ays

    Presenters D evices W eb UI DB External Interfaces @ivanpaulovich •Abstractness increases with stability. •Modules depend in the direction of stability. •Classes that change together are packaged together.
  10. Entities Use Cases Controllers Presenters Gateways Devices UI DB Web

    External Interfaces Abstract,
 General,
 Stable,
 Consistent Concrete,
 Speci f i c, 
 Unstable, Inconsistent Level Clean Architecture @ivanpaulovich
  11. Patterns • Use case as central organizing structure. • Ports

    and Adapters Pattern from Hexagonal Architecture.
  12. Wrapping up Clean Architecture • Clean Architecture is about usage

    and the use cases are the central organizing structure. • Use cases implementation are guided by tests. • The User Interface and secondary actors are designed to ful f i l the core needs. • Defer decisions by implementing the simplest component f i rst. 16 @ivanpaulovich