clean architecture in practice - cs.uns.edu.arece/ads/downloads/practica/clean architecture...

Post on 31-Aug-2019

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

EMMANUEL.LAGARRIGUE@CS.UNS.EDU.ARL 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

�2

ARQUITECTURA DE SOFTWARE

�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.

�4

PATRONES ARQUITECTÓNICOS COMUNES

�5

BAG OF CATS

�6

artistas nacionales

Spotify

Artist

SearchView

SpotifyService

�7

MVC

�8

artistas nacionales

view

Spotify

controller

modelSearchView

SearchController

ArtistSearchModel

SpotifyService

�9

MVP

�10

artistas nacionales

view

Spotify

presenter

modelSearchView

SearchPresenter

SearchModel

SpotifyService

Artist

�11

MVVM

�12artistas nacionales

view

Spotify

view model

modelSearchView

SearchViewModel

SearchModel

SpotifyService

Artist

�13

MVI

�14

artistas nacionales

view

Spotify

presenter

model

Publishes action

Publishesresults

Publishes view state

SearchView

SearchControllerSearchReducer

SearchModel

SpotifyService

Artist

�15

PATRONES EMPRESARIALES

�16

3 CAPAS

�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

�18

�19

¿Y LAS INTERFACES?

�20

INVERSIÓN DE DEPENDENCIAS

�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

�22

CLEAN ARCHITECTURE

�23

�24

�25

�26

�27

�28

INVERSIÓN DE DEPENDENCIAS

�29

�30

INYECCIÓN DE DEPENDENCIAS

�31

INYECTORES DE DEPENDENCIAS

�32

PACKAGE BY FEATURE VS PACKAGE BY LAYER

�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

�34

�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

�36

top related