clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture...
Transcript of clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture...
![Page 1: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/1.jpg)
[email protected] I C . E M M A N U E L L A G A R R I G U E L A Z A R T E �1AY
DS
- DC
IC -
UN
S
CLEAN ARCHITECTURE IN PRACTICE
![Page 2: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/2.jpg)
�2
ARQUITECTURA DE SOFTWARE
![Page 3: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/3.jpg)
�3
The goal of software architecture is to minimize the human resources required to build and maintain the required system.
The measure of design quality is simply the measure of the effort required to meet the needs of the customer. If that effort is low, and stays low throughout the lifetime of the system, the design is good. If that effort grows with each new release, the design is bad.
![Page 4: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/4.jpg)
�4
PATRONES ARQUITECTÓNICOS COMUNES
![Page 5: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/5.jpg)
�5
BAG OF CATS
![Page 6: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/6.jpg)
�6
artistas nacionales
Spotify
Artist
SearchView
SpotifyService
![Page 7: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/7.jpg)
�7
MVC
![Page 8: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/8.jpg)
�8
artistas nacionales
view
Spotify
controller
modelSearchView
SearchController
ArtistSearchModel
SpotifyService
![Page 9: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/9.jpg)
�9
MVP
![Page 10: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/10.jpg)
�10
artistas nacionales
view
Spotify
presenter
modelSearchView
SearchPresenter
SearchModel
SpotifyService
Artist
![Page 11: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/11.jpg)
�11
MVVM
![Page 12: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/12.jpg)
�12artistas nacionales
view
Spotify
view model
modelSearchView
SearchViewModel
SearchModel
SpotifyService
Artist
![Page 13: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/13.jpg)
�13
MVI
![Page 14: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/14.jpg)
�14
artistas nacionales
view
Spotify
presenter
model
Publishes action
Publishesresults
Publishes view state
SearchView
SearchControllerSearchReducer
SearchModel
SpotifyService
Artist
![Page 15: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/15.jpg)
�15
PATRONES EMPRESARIALES
![Page 16: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/16.jpg)
�16
3 CAPAS
![Page 17: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/17.jpg)
�17
spotify
data
artistas nacionales
view
Spotify
presenter model
SearchView SearchPresenter SearchModel
SpotifyService
presentation
business logic
SearchLogic Artist
domain
business models
business logic
ArtistRepository
artist data access
![Page 18: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/18.jpg)
�18
![Page 19: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/19.jpg)
�19
¿Y LAS INTERFACES?
![Page 20: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/20.jpg)
�20
INVERSIÓN DE DEPENDENCIAS
![Page 21: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/21.jpg)
�21
spotify
data
artistas nacionales
view
Spotify
presenter model
SearchView SearchPresenter SearchModel
SpotifyService
presentation
business logic
SearchLogicImpl
Artist
domain
business models
ArtistRepositoryImplartist data access
businessinterfaces «interface»
SearchLogic
data accesinterfaces «interface»
ArtistRepository
![Page 22: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/22.jpg)
�22
CLEAN ARCHITECTURE
![Page 23: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/23.jpg)
�23
![Page 24: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/24.jpg)
�24
![Page 25: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/25.jpg)
�25
![Page 26: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/26.jpg)
�26
![Page 27: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/27.jpg)
�27
![Page 28: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/28.jpg)
�28
INVERSIÓN DE DEPENDENCIAS
![Page 29: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/29.jpg)
�29
![Page 30: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/30.jpg)
�30
INYECCIÓN DE DEPENDENCIAS
![Page 31: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/31.jpg)
�31
INYECTORES DE DEPENDENCIAS
![Page 32: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/32.jpg)
�32
PACKAGE BY FEATURE VS PACKAGE BY LAYER
![Page 33: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/33.jpg)
�33
spotify
data
artistas nacionales
artists
Spotify
SearchView SearchPresenter SearchModel
SpotifyService
presentation
domain
ArtistRepositoryImplartists
artists «interface»SearchLogic
«interface»ArtistRepository
SearchLogicImpl
Artist
ArtistView
ArtistViewMapper
ArtistResponse
ArtistRespoinseMapper
![Page 34: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/34.jpg)
�34
![Page 35: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/35.jpg)
�35
https://blog.cleancoder.com/uncle-bob/2011/09/30/Screaming-Architecture.htmlhttps://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.htmlhttps://fernandocejas.com/2014/09/03/architecting-android-the-clean-way
![Page 36: clean architecture in practice - cs.uns.edu.arece/ads/downloads/Practica/clean architecture in... · CLEAN ARCHITECTURE IN PRACTICE. 2 ARQUITECTURA DE SOFTWARE. 3 The goal of software](https://reader030.fdocuments.net/reader030/viewer/2022041212/5dd1233fd6be591ccb64670e/html5/thumbnails/36.jpg)
�36