SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
MVP Architecture
Himanshu Dudhat | Android Developer
Why we need software design pattern
• Clear Usecases
• Easy to maintain
• Easy to test
• Very cohesive. Easy to understand
• Decoupled
What is role of architecture
What is a role of developer
Why we choose MVP over MVC and MVVM
• What is MVC – Model View Control
• Android provide MVC by default
• Controller is tightly coupled with view. Each action is correlated to call of Controller with
view action.
• What is MVVM – Model View View-Model
• Model –business rules
• View- layout
• ViewModel- Bridge for model and view
• Avoided as its newly introduced and binding is still not supported in some views
Continue...
• Why MVP
• Totally decoupled
• Each layer can easily testable separately
• Modularize code
• Usecase can be well maintained.
• Easily scalable
What is MVP
• The Presenter
• The presenter is responsible to act as the middle man between view and model. It
retrieves data from the model and returns it formatted to the view.
• The View
• The view-interface, usually implemented by an Activity (it may be a Fragment, a View
depending on how the app is structured), will contain a reference to the presenter. It will
be responsible for creating the presenter object. The only thing that the view will do is
calling a method from the presenter every time there is an interface action (a button click
for example).
• The model
• Model would only be the gateway to the domain layer or business logic. The model would
probably be an interactor that implements a use case.
Clean architecture by Unkle Bobs
Source : 8thlight.com
Continue...
• Entities
• Enterprise level classes
• Usecases
• Handle the flow to and from the entities
• InterfaceAdapter
• This is a set of the adapter converts data from the format most convenient for the
usecase and entities(Presenter and controllers belong here)
• Framework and Drivers
• Contains all the detail related to the app. UI, Framework and database etc.
App architecture
• Application business rules
• All use cases
• Usecases implementation
(Controllers)
• Can access Entities Classes
• Junit or Mockito (functional
testing) can be applicable here
Domain Layer (Domain module)
• Basic java classes or we can
say Utility classes
• That can also be functionally
tested by Junit or Mockito
• This layer is not related to app
business rules and it is
decoupled
• This layer can be used any app
Entities Layer (Framework Module)
• Logic related to UI.
• Logic related to Activity or Fragment
or View life cycle
• Fragment and Activities are only
views in over case
• Strongly connected to Android SDK
• Integration testing, UI tests
• Tools: Espresso, Robotium or
Roboletic
Presentation layer (app module)
• Deliver data needed in app
• Ether from database, web api or file
storage
• For database it is recommended to
use ORM
• And for web api Retrofit or Volley
Data Layer (Model Module)
Code Time
References
• Clean architecture by Unkle Bobs
• http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
• Android arch. By Saul Molinero
• http://saulmm.github.io/2015/02/02/A-useful-stack-on-android-1,-architecture/
• Other
• https://github.com/antoniolg/androidmvp
• http://antonioleiva.com/mvp-android
Questions?
Thanks!
+HimanshuDudhat
@HimanshuDudhat
himanshu.dudhat@gmail.com
Himanshu Dudhat
Team Lead - Android @ Cygnet Infotech Pvt. Ltd.
Sr. Software Engineer @ Cygnet Infotech Pvt. Ltd

Mais conteúdo relacionado

Mais procurados

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 2023Steve Pember
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net coreSam Nasr, MCSA, MVP
 
Test Automation Interview Questions and Answers | Edureka
Test Automation Interview Questions and Answers | EdurekaTest Automation Interview Questions and Answers | Edureka
Test Automation Interview Questions and Answers | EdurekaEdureka!
 
Rest api 테스트 수행가이드
Rest api 테스트 수행가이드Rest api 테스트 수행가이드
Rest api 테스트 수행가이드SangIn Choung
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design PrinciplesAndreas Enbohm
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )Ahmed Emad
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns pptAman Jain
 
Hexagonal architecture - message-oriented software design
Hexagonal architecture  - message-oriented software designHexagonal architecture  - message-oriented software design
Hexagonal architecture - message-oriented software designMatthias Noback
 
Jetpack Compose beginner.pdf
Jetpack Compose beginner.pdfJetpack Compose beginner.pdf
Jetpack Compose beginner.pdfAayushmaAgrawal
 
Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Maksym Husar
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservicesAnil Allewar
 

Mais procurados (20)

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
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
 
Test Automation Interview Questions and Answers | Edureka
Test Automation Interview Questions and Answers | EdurekaTest Automation Interview Questions and Answers | Edureka
Test Automation Interview Questions and Answers | Edureka
 
core java
core javacore java
core java
 
Rest api 테스트 수행가이드
Rest api 테스트 수행가이드Rest api 테스트 수행가이드
Rest api 테스트 수행가이드
 
Spring boot
Spring bootSpring boot
Spring boot
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Java basic
Java basicJava basic
Java basic
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
Hexagonal architecture - message-oriented software design
Hexagonal architecture  - message-oriented software designHexagonal architecture  - message-oriented software design
Hexagonal architecture - message-oriented software design
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Jetpack Compose beginner.pdf
Jetpack Compose beginner.pdfJetpack Compose beginner.pdf
Jetpack Compose beginner.pdf
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Junit
JunitJunit
Junit
 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptx
 
Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Clean code: SOLID (iOS)
Clean code: SOLID (iOS)
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 

Destaque

Android Architecture MVP Pattern
Android Architecture MVP Pattern Android Architecture MVP Pattern
Android Architecture MVP Pattern Jeff Potter
 
Infinum Android Talks #12 - MVP design pattern for Android Apps
Infinum Android Talks #12 - MVP design pattern for Android AppsInfinum Android Talks #12 - MVP design pattern for Android Apps
Infinum Android Talks #12 - MVP design pattern for Android AppsInfinum
 
To Protect & To Serve
To Protect & To ServeTo Protect & To Serve
To Protect & To ServeJorge Ortiz
 
Clean Architecture in Android. UPTech TechTalk
Clean Architecture in Android. UPTech TechTalkClean Architecture in Android. UPTech TechTalk
Clean Architecture in Android. UPTech TechTalkHalyna Halkina
 
Android clean architecture workshop 3h edition
Android clean architecture workshop 3h editionAndroid clean architecture workshop 3h edition
Android clean architecture workshop 3h editionJorge Ortiz
 
Android Effective UI: Tips, Tricks and Patterns
Android Effective UI: Tips, Tricks and PatternsAndroid Effective UI: Tips, Tricks and Patterns
Android Effective UI: Tips, Tricks and PatternsAdham Enaya
 
Rendra Toro - Model View Presenter
Rendra Toro - Model View PresenterRendra Toro - Model View Presenter
Rendra Toro - Model View PresenterDicoding
 
Sexy Architecting. VIPER: MVP on steroids
Sexy Architecting. VIPER: MVP on steroidsSexy Architecting. VIPER: MVP on steroids
Sexy Architecting. VIPER: MVP on steroidsDmytro Zaitsev
 
Android DevConference - Android Clean Architecture
Android DevConference - Android Clean ArchitectureAndroid DevConference - Android Clean Architecture
Android DevConference - Android Clean ArchitectureiMasters
 
Yoza Aprilio - We must design
Yoza Aprilio - We must designYoza Aprilio - We must design
Yoza Aprilio - We must designDicoding
 
Onion Architecture
Onion ArchitectureOnion Architecture
Onion Architecturematthidinger
 
Architecting ASP.NET MVC Applications
Architecting ASP.NET MVC ApplicationsArchitecting ASP.NET MVC Applications
Architecting ASP.NET MVC ApplicationsGunnar Peipman
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015Hossein Zahed
 
Repository and Unit Of Work Design Patterns
Repository and Unit Of Work Design PatternsRepository and Unit Of Work Design Patterns
Repository and Unit Of Work Design PatternsHatim Hakeel
 
Generic repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity FrameworkGeneric repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity FrameworkMd. Mahedee Hasan
 
Lightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignLightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignDeivison Sporteman
 
A Separation of Concerns: Clean Architecture on Android
A Separation of Concerns: Clean Architecture on AndroidA Separation of Concerns: Clean Architecture on Android
A Separation of Concerns: Clean Architecture on AndroidOutware Mobile
 

Destaque (20)

Android Architecture MVP Pattern
Android Architecture MVP Pattern Android Architecture MVP Pattern
Android Architecture MVP Pattern
 
GreenRobot-Eventbus
GreenRobot-EventbusGreenRobot-Eventbus
GreenRobot-Eventbus
 
Infinum Android Talks #12 - MVP design pattern for Android Apps
Infinum Android Talks #12 - MVP design pattern for Android AppsInfinum Android Talks #12 - MVP design pattern for Android Apps
Infinum Android Talks #12 - MVP design pattern for Android Apps
 
To Protect & To Serve
To Protect & To ServeTo Protect & To Serve
To Protect & To Serve
 
Clean Architecture in Android. UPTech TechTalk
Clean Architecture in Android. UPTech TechTalkClean Architecture in Android. UPTech TechTalk
Clean Architecture in Android. UPTech TechTalk
 
Android clean architecture workshop 3h edition
Android clean architecture workshop 3h editionAndroid clean architecture workshop 3h edition
Android clean architecture workshop 3h edition
 
ButterKnife
ButterKnifeButterKnife
ButterKnife
 
Android Effective UI: Tips, Tricks and Patterns
Android Effective UI: Tips, Tricks and PatternsAndroid Effective UI: Tips, Tricks and Patterns
Android Effective UI: Tips, Tricks and Patterns
 
Viper architecture
Viper architectureViper architecture
Viper architecture
 
Rendra Toro - Model View Presenter
Rendra Toro - Model View PresenterRendra Toro - Model View Presenter
Rendra Toro - Model View Presenter
 
Sexy Architecting. VIPER: MVP on steroids
Sexy Architecting. VIPER: MVP on steroidsSexy Architecting. VIPER: MVP on steroids
Sexy Architecting. VIPER: MVP on steroids
 
Android DevConference - Android Clean Architecture
Android DevConference - Android Clean ArchitectureAndroid DevConference - Android Clean Architecture
Android DevConference - Android Clean Architecture
 
Yoza Aprilio - We must design
Yoza Aprilio - We must designYoza Aprilio - We must design
Yoza Aprilio - We must design
 
Onion Architecture
Onion ArchitectureOnion Architecture
Onion Architecture
 
Architecting ASP.NET MVC Applications
Architecting ASP.NET MVC ApplicationsArchitecting ASP.NET MVC Applications
Architecting ASP.NET MVC Applications
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
 
Repository and Unit Of Work Design Patterns
Repository and Unit Of Work Design PatternsRepository and Unit Of Work Design Patterns
Repository and Unit Of Work Design Patterns
 
Generic repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity FrameworkGeneric repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity Framework
 
Lightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and DesignLightning Talk - Clean Architecture and Design
Lightning Talk - Clean Architecture and Design
 
A Separation of Concerns: Clean Architecture on Android
A Separation of Concerns: Clean Architecture on AndroidA Separation of Concerns: Clean Architecture on Android
A Separation of Concerns: Clean Architecture on Android
 

Semelhante a MVP Clean Architecture

Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesQamar Abbas
 
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & PatternsInocentshuja Ahmad
 
MVC Seminar Presantation
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar PresantationAbhishek Yadav
 
software architecture
software architecturesoftware architecture
software architecturearnav gupta
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVMBoulos Dib
 
Porting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidancePorting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidanceOur Community Exchange LLC
 
Android architectural components
Android architectural componentsAndroid architectural components
Android architectural componentsMuhammad Ali
 
Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fairTech_MX
 
Interaction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptxInteraction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptxGodwin Monserate
 
Web engineering - MVC
Web engineering - MVCWeb engineering - MVC
Web engineering - MVCNosheen Qamar
 
Software archiecture lecture08
Software archiecture   lecture08Software archiecture   lecture08
Software archiecture lecture08Luktalja
 
An Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPagesAn Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPagesUlrich Krause
 
J2EE Patterns
J2EE PatternsJ2EE Patterns
J2EE PatternsEmprovise
 
MVC architecture in software programming for interactive apps
MVC architecture in software programming for interactive appsMVC architecture in software programming for interactive apps
MVC architecture in software programming for interactive appsKotiTenali
 

Semelhante a MVP Clean Architecture (20)

Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & Patterns
 
MVC Seminar Presantation
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar Presantation
 
Adopting MVVM
Adopting MVVMAdopting MVVM
Adopting MVVM
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
MVC.pptx
MVC.pptxMVC.pptx
MVC.pptx
 
software architecture
software architecturesoftware architecture
software architecture
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVM
 
Porting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidancePorting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application Guidance
 
Android architectural components
Android architectural componentsAndroid architectural components
Android architectural components
 
MVVM and Prism
MVVM and PrismMVVM and Prism
MVVM and Prism
 
Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fair
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Interaction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptxInteraction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptx
 
Web engineering - MVC
Web engineering - MVCWeb engineering - MVC
Web engineering - MVC
 
Software archiecture lecture08
Software archiecture   lecture08Software archiecture   lecture08
Software archiecture lecture08
 
An Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPagesAn Introduction To Model  View  Controller In XPages
An Introduction To Model  View  Controller In XPages
 
J2EE Patterns
J2EE PatternsJ2EE Patterns
J2EE Patterns
 
MVC architecture in software programming for interactive apps
MVC architecture in software programming for interactive appsMVC architecture in software programming for interactive apps
MVC architecture in software programming for interactive apps
 
spring
springspring
spring
 

Último

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

MVP Clean Architecture

  • 1. MVP Architecture Himanshu Dudhat | Android Developer
  • 2. Why we need software design pattern • Clear Usecases • Easy to maintain • Easy to test • Very cohesive. Easy to understand • Decoupled
  • 3. What is role of architecture
  • 4. What is a role of developer
  • 5. Why we choose MVP over MVC and MVVM • What is MVC – Model View Control • Android provide MVC by default • Controller is tightly coupled with view. Each action is correlated to call of Controller with view action. • What is MVVM – Model View View-Model • Model –business rules • View- layout • ViewModel- Bridge for model and view • Avoided as its newly introduced and binding is still not supported in some views
  • 6. Continue... • Why MVP • Totally decoupled • Each layer can easily testable separately • Modularize code • Usecase can be well maintained. • Easily scalable
  • 7. What is MVP • The Presenter • The presenter is responsible to act as the middle man between view and model. It retrieves data from the model and returns it formatted to the view. • The View • The view-interface, usually implemented by an Activity (it may be a Fragment, a View depending on how the app is structured), will contain a reference to the presenter. It will be responsible for creating the presenter object. The only thing that the view will do is calling a method from the presenter every time there is an interface action (a button click for example). • The model • Model would only be the gateway to the domain layer or business logic. The model would probably be an interactor that implements a use case.
  • 8. Clean architecture by Unkle Bobs Source : 8thlight.com
  • 9. Continue... • Entities • Enterprise level classes • Usecases • Handle the flow to and from the entities • InterfaceAdapter • This is a set of the adapter converts data from the format most convenient for the usecase and entities(Presenter and controllers belong here) • Framework and Drivers • Contains all the detail related to the app. UI, Framework and database etc.
  • 11. • Application business rules • All use cases • Usecases implementation (Controllers) • Can access Entities Classes • Junit or Mockito (functional testing) can be applicable here Domain Layer (Domain module)
  • 12. • Basic java classes or we can say Utility classes • That can also be functionally tested by Junit or Mockito • This layer is not related to app business rules and it is decoupled • This layer can be used any app Entities Layer (Framework Module)
  • 13. • Logic related to UI. • Logic related to Activity or Fragment or View life cycle • Fragment and Activities are only views in over case • Strongly connected to Android SDK • Integration testing, UI tests • Tools: Espresso, Robotium or Roboletic Presentation layer (app module)
  • 14. • Deliver data needed in app • Ether from database, web api or file storage • For database it is recommended to use ORM • And for web api Retrofit or Volley Data Layer (Model Module)
  • 16. References • Clean architecture by Unkle Bobs • http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html • Android arch. By Saul Molinero • http://saulmm.github.io/2015/02/02/A-useful-stack-on-android-1,-architecture/ • Other • https://github.com/antoniolg/androidmvp • http://antonioleiva.com/mvp-android
  • 18. Thanks! +HimanshuDudhat @HimanshuDudhat himanshu.dudhat@gmail.com Himanshu Dudhat Team Lead - Android @ Cygnet Infotech Pvt. Ltd. Sr. Software Engineer @ Cygnet Infotech Pvt. Ltd