SlideShare a Scribd company logo
1 of 53
MVI in production
Mazhukin Oleg
Senior DataArt Developer
Mazhukin Oleg
Senior Android Developer
I Have over 5 years experience of developing Android apps
and came a long way through various architectures in
production. Have wide experience with different architecture
solutions from Loaders/Services to MVI.
How did we all start
Service/Loader Pattern
MVP
Clean Architecture
MVI
User app interaction
User app interaction
User app interaction
User app interaction
User app interaction
User app interaction
- UI is a cycle
- UI is a function
- UI is asynchronous
- UI симетричен с пользователем
- User is a function
User app interaction
User is a function
Reactive programming
Reactive programming
App architecture bullet points
- Events stream
- UI Stream
- Cycle
App architecture
Let’s talk about the model
Why model?
- State problem
- Screen orientation changes
- Process death
- Immutability
- Reproducible states
- Testability
Too complex?
- Flexibility
- Immutability
- Reproducible states
- Testability
- State partial change
States
Flow
What’s next?
- Complex States
- Side effects in MVI
- Testing
Disadvantages in MVI
- Can be too complex for new developers
- Becomes very complex for big states
- Hard to test all state flows
- Side effects still use MVP approach
- Lots if analyzing possible states
- UI redraws every time state changes
- Some logic need to be implemented on every screen
Advantages in MVI
- Reliable state
- Single method that changes view state
- View interface reflects it’s functionality
- Testability
- Force to decompose app
- Force to think about states and state changes
Available frameworks
-'com.hannesdorfmann.mosby3:mvi:3.1.0'
-'com.github.badoo.mvicore:mvicore:{latest-version}‘
-'com.freeletics.rxredux:rxredux:1.0.0'
Summary
Mazhukin Oleg
Senior Android Developer
Mail :mazhukin.social@gmail.com
LinkedIn: https://www.linkedin.com/in/oleg-mazhukin-7415847b/
https://github.com/HellCat24
Thank you!

More Related Content

Similar to MVI in production: From Loaders to MVI architecture

MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )Ahmed Emad
 
Basic Guide For Mobile Application Testing
Basic Guide For Mobile Application TestingBasic Guide For Mobile Application Testing
Basic Guide For Mobile Application TestingSourabh Kasliwal
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering Huda Alameen
 
IBM Innovate DevOps for Mobile Apps
IBM Innovate DevOps for Mobile Apps IBM Innovate DevOps for Mobile Apps
IBM Innovate DevOps for Mobile Apps Sanjeev Sharma
 
Wireless Wednesdays: Part 1
Wireless Wednesdays: Part 1Wireless Wednesdays: Part 1
Wireless Wednesdays: Part 1Teamstudio
 
Experitest & Tech Mahindra Co-Webinar
 Experitest & Tech Mahindra Co-Webinar Experitest & Tech Mahindra Co-Webinar
Experitest & Tech Mahindra Co-WebinarExperitest
 
Resume_Chintan Barot 3+ Years Exp in Testing.
Resume_Chintan Barot 3+ Years Exp in Testing.Resume_Chintan Barot 3+ Years Exp in Testing.
Resume_Chintan Barot 3+ Years Exp in Testing.Chintan Barot
 
1. introducción a la Ingeniería de Software (UTM 2071)
1. introducción a la Ingeniería de Software (UTM 2071)1. introducción a la Ingeniería de Software (UTM 2071)
1. introducción a la Ingeniería de Software (UTM 2071)Mario A Moreno Rocha
 
20170302 tryswift tasting_tests
20170302 tryswift tasting_tests20170302 tryswift tasting_tests
20170302 tryswift tasting_testsKazuaki Matsuo
 
Project on software engineering types of models
Project on software engineering types of modelsProject on software engineering types of models
Project on software engineering types of modelsSoham Nanekar
 
Mobile Web Performance Optimization 1-7-14
Mobile Web Performance Optimization 1-7-14Mobile Web Performance Optimization 1-7-14
Mobile Web Performance Optimization 1-7-14XBOSoft
 
Experitest & Wipro Co-Webinar
Experitest & Wipro Co-Webinar Experitest & Wipro Co-Webinar
Experitest & Wipro Co-Webinar Experitest
 
University of Miami Briefing: DevOps Steer – an agile response to customer fe...
University of Miami Briefing: DevOps Steer – an agile response to customer fe...University of Miami Briefing: DevOps Steer – an agile response to customer fe...
University of Miami Briefing: DevOps Steer – an agile response to customer fe...Roger Snook
 
Meetup kickoff slides - Perfecto Mobile, September 2014
Meetup kickoff slides - Perfecto Mobile, September 2014Meetup kickoff slides - Perfecto Mobile, September 2014
Meetup kickoff slides - Perfecto Mobile, September 2014Perfecto Mobile
 
Mobile Performance Testing Approaches and Challenges
Mobile Performance Testing Approaches and ChallengesMobile Performance Testing Approaches and Challenges
Mobile Performance Testing Approaches and ChallengesNous Infosystems
 
реалии использования Mv в i os разработке
реалии использования Mv в i os разработкереалии использования Mv в i os разработке
реалии использования Mv в i os разработкеProvectus
 

Similar to MVI in production: From Loaders to MVI architecture (20)

MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )
 
Sdlc models
Sdlc modelsSdlc models
Sdlc models
 
Pawan Resume
Pawan ResumePawan Resume
Pawan Resume
 
Basic Guide For Mobile Application Testing
Basic Guide For Mobile Application TestingBasic Guide For Mobile Application Testing
Basic Guide For Mobile Application Testing
 
Pawan Resume
Pawan ResumePawan Resume
Pawan Resume
 
Softweare Engieering
Softweare Engieering Softweare Engieering
Softweare Engieering
 
IBM Innovate DevOps for Mobile Apps
IBM Innovate DevOps for Mobile Apps IBM Innovate DevOps for Mobile Apps
IBM Innovate DevOps for Mobile Apps
 
Wireless Wednesdays: Part 1
Wireless Wednesdays: Part 1Wireless Wednesdays: Part 1
Wireless Wednesdays: Part 1
 
Experitest & Tech Mahindra Co-Webinar
 Experitest & Tech Mahindra Co-Webinar Experitest & Tech Mahindra Co-Webinar
Experitest & Tech Mahindra Co-Webinar
 
Resume_Chintan Barot 3+ Years Exp in Testing.
Resume_Chintan Barot 3+ Years Exp in Testing.Resume_Chintan Barot 3+ Years Exp in Testing.
Resume_Chintan Barot 3+ Years Exp in Testing.
 
1. introducción a la Ingeniería de Software (UTM 2071)
1. introducción a la Ingeniería de Software (UTM 2071)1. introducción a la Ingeniería de Software (UTM 2071)
1. introducción a la Ingeniería de Software (UTM 2071)
 
20170302 tryswift tasting_tests
20170302 tryswift tasting_tests20170302 tryswift tasting_tests
20170302 tryswift tasting_tests
 
Project on software engineering types of models
Project on software engineering types of modelsProject on software engineering types of models
Project on software engineering types of models
 
Monolithic architecture
Monolithic architectureMonolithic architecture
Monolithic architecture
 
Mobile Web Performance Optimization 1-7-14
Mobile Web Performance Optimization 1-7-14Mobile Web Performance Optimization 1-7-14
Mobile Web Performance Optimization 1-7-14
 
Experitest & Wipro Co-Webinar
Experitest & Wipro Co-Webinar Experitest & Wipro Co-Webinar
Experitest & Wipro Co-Webinar
 
University of Miami Briefing: DevOps Steer – an agile response to customer fe...
University of Miami Briefing: DevOps Steer – an agile response to customer fe...University of Miami Briefing: DevOps Steer – an agile response to customer fe...
University of Miami Briefing: DevOps Steer – an agile response to customer fe...
 
Meetup kickoff slides - Perfecto Mobile, September 2014
Meetup kickoff slides - Perfecto Mobile, September 2014Meetup kickoff slides - Perfecto Mobile, September 2014
Meetup kickoff slides - Perfecto Mobile, September 2014
 
Mobile Performance Testing Approaches and Challenges
Mobile Performance Testing Approaches and ChallengesMobile Performance Testing Approaches and Challenges
Mobile Performance Testing Approaches and Challenges
 
реалии использования Mv в i os разработке
реалии использования Mv в i os разработкереалии использования Mv в i os разработке
реалии использования Mv в i os разработке
 

Recently uploaded

BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 

Recently uploaded (7)

BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 

MVI in production: From Loaders to MVI architecture

Editor's Notes

  1. Работаб с 2013, поскольку буду рассказывать про архитектуру давайте начнем с небольшого экскурса
  2. Добро пожаловать в плохой код
  3. Google IO 2010 показали пару подходов
  4. Прежде чем погружаться в реализацию архитектуры давайте абстрагируемся и поговорим про то как пользователи работают с приложениями
  5. Если абстрактно показать как пользователи работают с приложениями, то мы получил примерно такую схему. Важно понимать что здесь можно увидеть что UI представляет собой цикл
  6. UI это функция
  7. UI асинхронен
  8. Пользователи очень не любят ждать чего-то в приложении
  9. С другой стороны сами пользователи тоже функция
  10. Если рассмотреть их с друг другом, то можно увидеть симметрию
  11. Итак какие выводы можно сделать
  12. Так же если еще раз остановиться на том что пользователь эта функция, то можно выделать последовательность экранов и последовательность действий. При это они все просиходит по времени
  13. Итак для того чтобы перенести эту абстракцию в архитектуру в ней нужно отразить следующие моменты
  14. Давайте сразу смотреть на примере. Предположим что перед нами стоит задача сделать приложение поиск по github. Первое что можно увидеть что тут нужно знать rx.
  15. Стейт отражает текущее состояние экрана. Выглядит всё не очень – все происходит в одном месте. Давайте все разнесем
  16. Выделяем View
  17. Основную логику перенесем в презентер
  18. Посмотрим что у нас получилось. Понятно что этот код пока далек от совершенства, давай попробуем добавить progress
  19. Добавляем в разметку и вуаля все работает
  20. Но давайте на минутку оснановимся и поговорим про модель.
  21. Тогда давайте вернемся назад и кроме прогресса так же добавим ошибку в состояние
  22. Теперь все работает как хочется. Модель полностью отображает текущее состояние экрана и все круто
  23. Но на недел такой подход пока не гибкий и у него есть много недостатков. Основной то что нам каждый раз нужно констурировать модель. Это приводит к тому что при усложнении состояния нам придется полностью ее копировать
  24. Если еще раз посмотреть на модель
  25. Если еще раз посмотреть на модель
  26. Но давайте добавим еще продакшена. Сейчас у нас нету кэширования данных и рефреша. Добавим их
  27. Для view добавляем swipe to refresh
  28. Создаем UI цикл
  29. Добавляем пару новых chang’ов
  30. Сложные стейты
  31. Сложные стейты
  32. тесты