Share
Embed
Transcript
17 slides
-
Q&A Clean Architecture Ivan Paulovich www.meuacerto.com.br September 3th, 2020
https://paulovich.net @ivanpaulovich -
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 -
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 -
Business @ivanpaulovich 5 Ports and Adapters Cloud Messaging UI
In Memory Persistence Tests In Memory Messaging SQL -
Business @ivanpaulovich 6 Ports and Adapters Cloud Messaging UI
In Memory Persistence Tests In Memory Messaging SQL Ports -
Business v @ivanpaulovich 8 Ports and Adapters Cloud Messaging
UI In Memory Persistence Tests In Memory Messaging SQL Adapters -
Test-Driven Development (Practices) Deposit Use Case Customer Repository
Account Repository Test Expectations @ivanpaulovich -
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 -
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. -
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. -
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 -
Patterns • Use case as central organizing structure. • Ports
and Adapters Pattern from Hexagonal Architecture. -
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