SlideShare a Scribd company logo
1 of 36
The Clean
Architecture
S Single-responsiblity principle
O Open-closed principle
L Liskov substitution principle
I Interface segregation principle
D Dependency inversion principle
Solid Principles
Single-responsibility principle
A class should have one and only one reason to change,
meaning that a class should have only one job.
Open-closed principle
Objects or entities should be open for extension, but closed
for modification.
Liskov substitution principle
Every subclass/derived class should be substitutable for
their base/parent class.
Interface segregation principle
A class should never be forced to implement an interface
that it doesn't use and a class should never be forced to
implement methods that it doesn't use.
Dependency inversion principle
Entities must depend on abstractions not on concretions. It
states that the high level module must not depend on the
low level module, but they should depend on abstractions.
vs
Design Pattern
Software Architecture
MVC - MVVM - MVP
Design patterns or software architectures?
Design pattern
A design pattern is the re-usable form of a solution to a
design problem. (Singleton - Observer - MVC - MVVM -
MVP)
Software architecture
Software architecture refers to the high level structures of a
software system and the discipline of creating such
structures and systems. (Hexagonal architecture - Onion
architecture - The Clean architecture)
Successful Software
Architecture
Characteristics
Successful Software
Architecture Characteristics
• Testable
• Independent of the UI
• Independent of the Database
• Independent of Frameworks and External Entities
Testable
The business logic layer(s) can be tested without the UI, database, net
Independent of the UI
The UI can be easily modified, without changing the rest of the applica
Independent of the Database
You can swap out Core Data or SQLite, for Realm, Firebase or
something else entirely. Your business logic is not bound to the
database or persistence layer(s).
Independent of External Entities
The architecture does not depend on external libraries. This allows
the team to use them as tools, rather than having to adapt your
application(s) to their limited constraints and rigid conventions.
Why using Clean
Architecture?
To make your code:
The Clean Architecture
Entities are enterprise-wide business rules that encapsulate the most
general business rules, these rules are the least likely to change.
Use cases are also called interactors and stand for application-specific
business rules of the software. This layer is isolated from changes to the
database, common frameworks, and the UI.
Interface adapters convert data from a convenient format for entities and
use cases to a format applicable to databases and the web, for example.
This layer includes Presenters from MVP, ViewModel from MVVM, and
Gateways (also known as Repositories).
Frameworks and drivers are the outermost layer, which consists of the
web framework, database, UI, HTTP client, and so on.
- Interactor (Use Case): Contains application specific business rules.
- Entity: Contains application independent business rules.
- Boundary<I>: Data comes into interactors through boundary (interface/protocol) which is implemented by the
interactor. Data goes out from the interactor to boundaries implemented by other objects.
- Delivery Mechanism: Can be Web, Console application, Mobile App UI, etc
1- User clicks a button (on a web form for example).
2- The delivery mechanism (ex: Web) takes whatever data submitted by the user and stick it into a data
structure which contains only primitives types (Request Model).
3- The request model passed through the input boundary and since the interactor implements the input
boundary, the interactor received that request model.
4- Interactor then uses that request model and controls the dance of the entities (ex: creates the order,
modify the customer, etc).
5- And when it’s done with that, it continues to control the dance of the entities but this time in the opposite
direction as it gather up all the results to create yet another data structure called (Response Model).
6- The response model is passed back out through the output boundary to the delivery mechanism that
implement it and somehow it’s delivered to the user.
-Response Model contains data that was created by the interactor as the result of the use
case, but this data is not presentable, a date for example would be a date object, and the
currency would be a money object.
-Presenter is a class or a set of classes whose job is to take the response model and translate
it into a view model. For example, it takes the date object from the response model and calls
simple data formatter which generates a nice date string that the view model will hold, and
takes the currency from the response model and puts the currency symbol in the view model.
-View Model contains the data that will be used by the view. For example, If there is a button on
the view, the view model has the string that holds the name of that button, and if the button
shouldn’t be active, so it should be grey, the view model holds the boolean that indicates the
status of the button. If there are menu items in the view, the view model has the names of all
the menu items and their order.
-View all it can do is grabbing the data from the view model and put it on the screen. It should
be so stupid so you don’t have to test it. (You can test it with your eyes).
What about the
database?
–Robert C. Martin
“If something changes a lot, it should be a plug-in. If
something doesn’t change very often, it should be
plugged into.”
What about the database?
• The database is a detail, it shouldn’t be the center of your
architecture.
• The database should be a plug-in to the business rules.
• Business rules shouldn’t be written in stored procedures in
the database.
Real Life Example
List contacts use case
• List all the contacts from the local database and from the
phone database.
• Group the contacts by mobile number and remove the
duplicates.
• Present the filtered contacts in a table view.
Questions?
References:
• https://www.youtube.com/watch?v=o_TH-Y78tt4
• https://proandroiddev.com/clean-architecture-data-flow-dependency-rule-
615ffdd79e29
• https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-
architecture.html
• https://medium.freecodecamp.org/a-quick-introduction-to-clean-architecture-
990c014448d2
• https://medium.com/@pxpgraphics/clean-architecture-3fe6907e7441
• https://hackernoon.com/golang-clean-archithecture-efd6d7c43047
• https://rubygarage.org/blog/clean-android-architecture
Thank You!

More Related Content

What's hot

Clean architecture
Clean architectureClean architecture
Clean architecture
andbed
 

What's hot (20)

Clean architecture
Clean architectureClean architecture
Clean architecture
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Clean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software CraftsmanshipClean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software Craftsmanship
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Clean architecture on android
Clean architecture on androidClean architecture on android
Clean architecture on android
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 
Hexagonal architecture: how, why and when
Hexagonal architecture: how, why and whenHexagonal architecture: how, why and when
Hexagonal architecture: how, why and when
 
The Secrets of Hexagonal Architecture
The Secrets of Hexagonal ArchitectureThe Secrets of Hexagonal Architecture
The Secrets of Hexagonal Architecture
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
SOLID Design Principles applied in Java
SOLID Design Principles applied in JavaSOLID Design Principles applied in Java
SOLID Design Principles applied in Java
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Hexagonal architecture
Hexagonal architectureHexagonal architecture
Hexagonal architecture
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Hexagonal architecture - message-oriented software design
Hexagonal architecture  - message-oriented software designHexagonal architecture  - message-oriented software design
Hexagonal architecture - message-oriented software design
 

Similar to SOLID Principles and The Clean Architecture

1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
JOHNLEAK1
 
Cs 1023 lec 2 (week 1) edit 1
Cs 1023  lec 2 (week 1) edit 1Cs 1023  lec 2 (week 1) edit 1
Cs 1023 lec 2 (week 1) edit 1
stanbridge
 
Cs 1023 lec 2 (week 1) edit 1
Cs 1023  lec 2 (week 1) edit 1Cs 1023  lec 2 (week 1) edit 1
Cs 1023 lec 2 (week 1) edit 1
stanbridge
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
naina-rani
 

Similar to SOLID Principles and The Clean Architecture (20)

The Clean Architecture
The Clean ArchitectureThe Clean Architecture
The Clean Architecture
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
Design pattern
Design patternDesign pattern
Design pattern
 
MVC
MVCMVC
MVC
 
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
1-SDLC - Development Models – Waterfall, Rapid Application Development, Agile...
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
 
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
IRJET- MVC Framework: A Modern Web Application Development Approach and WorkingIRJET- MVC Framework: A Modern Web Application Development Approach and Working
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
 
Design patterns fast track
Design patterns fast trackDesign patterns fast track
Design patterns fast track
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Pattern oriented architecture for web based architecture
Pattern oriented architecture for web based architecturePattern oriented architecture for web based architecture
Pattern oriented architecture for web based architecture
 
Cs 1023 lec 2 (week 1) edit 1
Cs 1023  lec 2 (week 1) edit 1Cs 1023  lec 2 (week 1) edit 1
Cs 1023 lec 2 (week 1) edit 1
 
Cs 1023 lec 2 (week 1) edit 1
Cs 1023  lec 2 (week 1) edit 1Cs 1023  lec 2 (week 1) edit 1
Cs 1023 lec 2 (week 1) edit 1
 
[2016/2017] Introduction to Software Architecture
[2016/2017] Introduction to Software Architecture[2016/2017] Introduction to Software Architecture
[2016/2017] Introduction to Software Architecture
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
Gof design pattern
Gof design patternGof design pattern
Gof design pattern
 
[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture[2017/2018] Introduction to Software Architecture
[2017/2018] Introduction to Software Architecture
 
software_engg-chap-03.ppt
software_engg-chap-03.pptsoftware_engg-chap-03.ppt
software_engg-chap-03.ppt
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologies
 

Recently uploaded

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 

SOLID Principles and The Clean Architecture

  • 2. S Single-responsiblity principle O Open-closed principle L Liskov substitution principle I Interface segregation principle D Dependency inversion principle Solid Principles
  • 3. Single-responsibility principle A class should have one and only one reason to change, meaning that a class should have only one job. Open-closed principle Objects or entities should be open for extension, but closed for modification.
  • 4. Liskov substitution principle Every subclass/derived class should be substitutable for their base/parent class. Interface segregation principle A class should never be forced to implement an interface that it doesn't use and a class should never be forced to implement methods that it doesn't use.
  • 5. Dependency inversion principle Entities must depend on abstractions not on concretions. It states that the high level module must not depend on the low level module, but they should depend on abstractions.
  • 7. MVC - MVVM - MVP Design patterns or software architectures?
  • 8. Design pattern A design pattern is the re-usable form of a solution to a design problem. (Singleton - Observer - MVC - MVVM - MVP) Software architecture Software architecture refers to the high level structures of a software system and the discipline of creating such structures and systems. (Hexagonal architecture - Onion architecture - The Clean architecture)
  • 10. Successful Software Architecture Characteristics • Testable • Independent of the UI • Independent of the Database • Independent of Frameworks and External Entities
  • 11. Testable The business logic layer(s) can be tested without the UI, database, net Independent of the UI The UI can be easily modified, without changing the rest of the applica
  • 12. Independent of the Database You can swap out Core Data or SQLite, for Realm, Firebase or something else entirely. Your business logic is not bound to the database or persistence layer(s). Independent of External Entities The architecture does not depend on external libraries. This allows the team to use them as tools, rather than having to adapt your application(s) to their limited constraints and rigid conventions.
  • 14. To make your code:
  • 16.
  • 17. Entities are enterprise-wide business rules that encapsulate the most general business rules, these rules are the least likely to change. Use cases are also called interactors and stand for application-specific business rules of the software. This layer is isolated from changes to the database, common frameworks, and the UI. Interface adapters convert data from a convenient format for entities and use cases to a format applicable to databases and the web, for example. This layer includes Presenters from MVP, ViewModel from MVVM, and Gateways (also known as Repositories). Frameworks and drivers are the outermost layer, which consists of the web framework, database, UI, HTTP client, and so on.
  • 18.
  • 19. - Interactor (Use Case): Contains application specific business rules. - Entity: Contains application independent business rules. - Boundary<I>: Data comes into interactors through boundary (interface/protocol) which is implemented by the interactor. Data goes out from the interactor to boundaries implemented by other objects. - Delivery Mechanism: Can be Web, Console application, Mobile App UI, etc
  • 20. 1- User clicks a button (on a web form for example). 2- The delivery mechanism (ex: Web) takes whatever data submitted by the user and stick it into a data structure which contains only primitives types (Request Model). 3- The request model passed through the input boundary and since the interactor implements the input boundary, the interactor received that request model.
  • 21. 4- Interactor then uses that request model and controls the dance of the entities (ex: creates the order, modify the customer, etc).
  • 22. 5- And when it’s done with that, it continues to control the dance of the entities but this time in the opposite direction as it gather up all the results to create yet another data structure called (Response Model).
  • 23. 6- The response model is passed back out through the output boundary to the delivery mechanism that implement it and somehow it’s delivered to the user.
  • 24.
  • 25. -Response Model contains data that was created by the interactor as the result of the use case, but this data is not presentable, a date for example would be a date object, and the currency would be a money object. -Presenter is a class or a set of classes whose job is to take the response model and translate it into a view model. For example, it takes the date object from the response model and calls simple data formatter which generates a nice date string that the view model will hold, and takes the currency from the response model and puts the currency symbol in the view model. -View Model contains the data that will be used by the view. For example, If there is a button on the view, the view model has the string that holds the name of that button, and if the button shouldn’t be active, so it should be grey, the view model holds the boolean that indicates the status of the button. If there are menu items in the view, the view model has the names of all the menu items and their order. -View all it can do is grabbing the data from the view model and put it on the screen. It should be so stupid so you don’t have to test it. (You can test it with your eyes).
  • 27. –Robert C. Martin “If something changes a lot, it should be a plug-in. If something doesn’t change very often, it should be plugged into.”
  • 28. What about the database? • The database is a detail, it shouldn’t be the center of your architecture. • The database should be a plug-in to the business rules. • Business rules shouldn’t be written in stored procedures in the database.
  • 29.
  • 30.
  • 32. List contacts use case • List all the contacts from the local database and from the phone database. • Group the contacts by mobile number and remove the duplicates. • Present the filtered contacts in a table view.
  • 33.
  • 35. References: • https://www.youtube.com/watch?v=o_TH-Y78tt4 • https://proandroiddev.com/clean-architecture-data-flow-dependency-rule- 615ffdd79e29 • https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean- architecture.html • https://medium.freecodecamp.org/a-quick-introduction-to-clean-architecture- 990c014448d2 • https://medium.com/@pxpgraphics/clean-architecture-3fe6907e7441 • https://hackernoon.com/golang-clean-archithecture-efd6d7c43047 • https://rubygarage.org/blog/clean-android-architecture

Editor's Notes

  1. We can use multiple design pattern in a single software, but we cannot use multiple architectures in a single software
  2. Robert C. Marten Known in our field as Uncle Bob American Software Engineer Clean Architecture (Augest 2012) Inventor of SOLID principles Clean Code The Clean Coder Clean Architecture
  3. Dependency Rule
  4. Entities: TopUp products Use Cases: TopUp operation
  5. The blog figure The Clean Architecture Cone Simplified My favorite
  6. Usually interactors talks to several entities, ex: CreateOrderInteractor talks to OrderEntity and CustomerEntity. Has-A vs Is-A
  7. Login Use Case LoginDataStructure
  8. Now the interactors can be tested by giving them the request model and get the response model out from them.
  9. Plug-In Architecture Pattern