SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
Engineering Wunderlist for
Android
César Valiente
Who is this guy?
Image Placeholder
César Valiente
Android Engineer @Wunderlist (@Microsoft)
FLOSS & Android Google Developer Expert (GDE)
+CesarValiente @CesarValiente
- A very nice and good
app.
- Monolithic structure.
- Highly coupled.
- Sync in batch.
- Difficult to test .
Wunderlist 2
Wunderlist 3
- Completely redesigned.
- Divided into modules (layers).
- Highly decoupled.
- Real time sync.
- Easier to maintain, test and adapt.
- Easy to understand.
PARENTAL ADVISORY
The following architecture is shared between all
Wunderlist platforms!
yes,
iOS, Android, Mac OSX, Web and Windows.
Layers
Android
Layer
Sync
Layer
SDK
Layer
Presentation layer
(UI and Android stuff)
Model layer
(Business logic)
Data layer
(Accessing to the API data)
Android project Java project Java project
Sync boundaries SDK boundaries
Dependency rule
The outer model knows
the inner, not viceversa.
Presentation
Sync
Sdk
Interfaces are the key
Layered architecture
package com.wunderlist.sdk;
• Websocket (real time).
• REST.
• Services
Network
• API data models.
• Serializers/deserializers.
• Interfaces/callbacks.
• Sync and async tests.
API model
SDK
Real time (websocket)
Request to setup a web socket connection
Response to accept the request
Payload
Payload
Close payload
Initial
handshake
Bidirectional flow
of packets
Closing
the connection
Real time (2)
package com.wunderlist.sync;
Sync
• Data models.
• Deserializers from the
basic model.
• Cache.
• Services that manage
data.
Data
• Matryoshka (aka Russian
doll).
• Conflict resolver (included in
Matryoshka).
Sync logic
Cache
• Caches for different models (Tasks, Lists, Memberships, etc.)
• Data interface which our database model (in presentation layer) and
Cache implement to work on the same way.
Datainterface
Store
Manager
DDBB
Cache
Services
public class WLTaskService extends WLService<WLTask, TaskService> {



public WLTaskService(Client client) {

super(new TaskService(client));

}
public void getCompletedTasks(final WLList list, final SyncCallback uiCallbacks) {

ResponseCallback responseCallback = new ResponseCallback() {





service.getCompletedTasksForList(list.getId(), responseCallback);
}
@Override

public void onSuccess(Response response) {
//Manage your response

uiCallbacks.onSuccess(tasks);
}
@Override

public void onFailure(Response response) {

//Manage your response

uiCallbacks.onFailure(response);

}

};
Used to communicate the Android layer with the
SDK.
Matryoshka
(Russian Doll)
Mechanism to properly
sync entire model.
Revision based.
When a child is updated the revision changes the whole tree up
(eg.: when a Task is created the List's revision is incremented,
as well the root).
package com.wunderlist.wunderlistandroid;
Presentation layer
• UI + Android libs and code.
• Maximized decoupling among UI and business
logic.
• Database, sadly, is located here (native SQLite
ddbb).
Communication
Activity/Fragment
A
Fragment
B
(do something that the
Activity/Fragment A
uses to update its UI)
BUS
Subscription Data Data
Code which manages
a mutation
(this data has to be used
by the Activity/Fragment A)
Data
Retrieving local data
Loader
(Gets the data and
does something with it)
Activity/Fragment
BUS
Subscription Data
Event or data
is fired
Data
What’s next (WIP)?
Presenter
(Supervising controller)
Passive view
User events
Updates model
Updates view
State-changes event
Model
Model View Presenter (MVP)
Java project
Sync
(domain)MVP
Presentation
Interactors
(use cases)
Repository
Cache
Web
socket
DDBB
REST
Data
Repository
interface
Clean Architecture
?+CesarValiente @CesarValiente
License
(cc) 2015 César Valiente. Some rights reserved. This document is distributed
under the Creative Commons Attribution-ShareAlike 3.0 license, available in http://
creativecommons.org/licenses/by-sa/3.0/
Image licenses
• Wunderlist images: permission granted.
• Computer (CC0): http://goo.gl/ChBXuX
• Server (CC0): https://goo.gl/WRTm4y
• Matryoshka (CC0): http://goo.gl/HWgVa6
• ReactiveX logo (CC-BY 3.0, ReactiveX): http://goo.gl/hK076f

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

React state managmenet with Redux
React state managmenet with ReduxReact state managmenet with Redux
React state managmenet with Redux
 
React Native: JS MVC Meetup #15
React Native: JS MVC Meetup #15React Native: JS MVC Meetup #15
React Native: JS MVC Meetup #15
 
Redux vs Alt
Redux vs AltRedux vs Alt
Redux vs Alt
 
An Introduction to ReactJS
An Introduction to ReactJSAn Introduction to ReactJS
An Introduction to ReactJS
 
Mobile Day - React Native
Mobile Day - React NativeMobile Day - React Native
Mobile Day - React Native
 
Redux training
Redux trainingRedux training
Redux training
 
Springを用いた社内ライブラリ開発
Springを用いた社内ライブラリ開発Springを用いた社内ライブラリ開発
Springを用いた社内ライブラリ開発
 
React redux
React reduxReact redux
React redux
 
Protocol Oriented MVVM - Auckland iOS Meetup
Protocol Oriented MVVM - Auckland iOS MeetupProtocol Oriented MVVM - Auckland iOS Meetup
Protocol Oriented MVVM - Auckland iOS Meetup
 
Academy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & ToolingAcademy PRO: React JS. Redux & Tooling
Academy PRO: React JS. Redux & Tooling
 
Workshop 22: React-Redux Middleware
Workshop 22: React-Redux MiddlewareWorkshop 22: React-Redux Middleware
Workshop 22: React-Redux Middleware
 
Modern Web Apps Development 101
Modern Web Apps Development 101Modern Web Apps Development 101
Modern Web Apps Development 101
 
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис ЛебедевВстреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
 
Angular & RXJS: examples and use cases
Angular & RXJS: examples and use casesAngular & RXJS: examples and use cases
Angular & RXJS: examples and use cases
 
Managing user's data with Spring Session
Managing user's data with Spring SessionManaging user's data with Spring Session
Managing user's data with Spring Session
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
React js use contexts and useContext hook
React js use contexts and useContext hookReact js use contexts and useContext hook
React js use contexts and useContext hook
 
JavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.asyncJavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.async
 
Hello, ReactorKit 
Hello, ReactorKit Hello, ReactorKit 
Hello, ReactorKit 
 
React / Redux Architectures
React / Redux ArchitecturesReact / Redux Architectures
React / Redux Architectures
 

Destacado

Destacado (19)

MBLT16: Alexander Lukin, AppMetrica
MBLT16: Alexander Lukin, AppMetricaMBLT16: Alexander Lukin, AppMetrica
MBLT16: Alexander Lukin, AppMetrica
 
MBLT16: Andrey Bakalenko, Sberbank Online
MBLT16: Andrey Bakalenko, Sberbank OnlineMBLT16: Andrey Bakalenko, Sberbank Online
MBLT16: Andrey Bakalenko, Sberbank Online
 
MBLT16: Marvin Liao, 500Startups
MBLT16: Marvin Liao, 500StartupsMBLT16: Marvin Liao, 500Startups
MBLT16: Marvin Liao, 500Startups
 
MBLTDev15: Artemiy Sobolev, Parallels
MBLTDev15: Artemiy Sobolev, ParallelsMBLTDev15: Artemiy Sobolev, Parallels
MBLTDev15: Artemiy Sobolev, Parallels
 
MBLTDev: Evgeny Lisovsky, Litres
MBLTDev: Evgeny Lisovsky, LitresMBLTDev: Evgeny Lisovsky, Litres
MBLTDev: Evgeny Lisovsky, Litres
 
MBLT16: Vincent Wu, Alibaba Mobile
MBLT16: Vincent Wu, Alibaba MobileMBLT16: Vincent Wu, Alibaba Mobile
MBLT16: Vincent Wu, Alibaba Mobile
 
MBLTDev15: Alexander Orlov, Postforpost
MBLTDev15: Alexander Orlov, PostforpostMBLTDev15: Alexander Orlov, Postforpost
MBLTDev15: Alexander Orlov, Postforpost
 
MBLT16: Dmitriy Geranin, Afisha Restorany
MBLT16: Dmitriy Geranin, Afisha RestoranyMBLT16: Dmitriy Geranin, Afisha Restorany
MBLT16: Dmitriy Geranin, Afisha Restorany
 
MBLT16: Andrey Maslak, Aviasales
MBLT16: Andrey Maslak, AviasalesMBLT16: Andrey Maslak, Aviasales
MBLT16: Andrey Maslak, Aviasales
 
Rx java
Rx javaRx java
Rx java
 
Rx Java architecture
Rx Java architectureRx Java architecture
Rx Java architecture
 
MBLT16: Elena Rydkina, Pure
MBLT16: Elena Rydkina, PureMBLT16: Elena Rydkina, Pure
MBLT16: Elena Rydkina, Pure
 
MBLTDev15: Konstantin Goldshtein, Microsoft
MBLTDev15: Konstantin Goldshtein, MicrosoftMBLTDev15: Konstantin Goldshtein, Microsoft
MBLTDev15: Konstantin Goldshtein, Microsoft
 
MBLTDev15: Hector Zarate, Spotify
MBLTDev15: Hector Zarate, SpotifyMBLTDev15: Hector Zarate, Spotify
MBLTDev15: Hector Zarate, Spotify
 
MBLTDev15: Brigit Lyons, Soundcloud
MBLTDev15: Brigit Lyons, SoundcloudMBLTDev15: Brigit Lyons, Soundcloud
MBLTDev15: Brigit Lyons, Soundcloud
 
MBLT15: Ivan Kozlov, Aviasales
MBLT15: Ivan Kozlov, AviasalesMBLT15: Ivan Kozlov, Aviasales
MBLT15: Ivan Kozlov, Aviasales
 
MBLTDev: Alexander Dimchenko, Bright Box
MBLTDev: Alexander Dimchenko, Bright Box MBLTDev: Alexander Dimchenko, Bright Box
MBLTDev: Alexander Dimchenko, Bright Box
 
Успешный кейс использования React Native в продакшне, Евгений Федоров (LOOKBUCK)
Успешный кейс использования React Native в продакшне, Евгений Федоров (LOOKBUCK)Успешный кейс использования React Native в продакшне, Евгений Федоров (LOOKBUCK)
Успешный кейс использования React Native в продакшне, Евгений Федоров (LOOKBUCK)
 
Изоморфные react-приложения
Изоморфные react-приложенияИзоморфные react-приложения
Изоморфные react-приложения
 

Similar a MBLTDev15: Cesar Valiente, Wunderlist

Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia
sapientindia
 
Memento Pattern Implementation
Memento Pattern ImplementationMemento Pattern Implementation
Memento Pattern Implementation
Steve Widom
 

Similar a MBLTDev15: Cesar Valiente, Wunderlist (20)

Engineering Wunderlist for Android - Ceasr Valiente, 6Wunderkinder
Engineering Wunderlist for Android - Ceasr Valiente, 6WunderkinderEngineering Wunderlist for Android - Ceasr Valiente, 6Wunderkinder
Engineering Wunderlist for Android - Ceasr Valiente, 6Wunderkinder
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
JEE on DC/OS
JEE on DC/OSJEE on DC/OS
JEE on DC/OS
 
JEE on DC/OS - MesosCon Europe
JEE on DC/OS - MesosCon EuropeJEE on DC/OS - MesosCon Europe
JEE on DC/OS - MesosCon Europe
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia
 
SOLID & IoC Principles
SOLID & IoC PrinciplesSOLID & IoC Principles
SOLID & IoC Principles
 
Scala.js for large and complex frontend apps
Scala.js for large and complex frontend appsScala.js for large and complex frontend apps
Scala.js for large and complex frontend apps
 
Sql lite android
Sql lite androidSql lite android
Sql lite android
 
BackboneJS + ReactJS
BackboneJS + ReactJSBackboneJS + ReactJS
BackboneJS + ReactJS
 
Android architecture blueprints overview
Android architecture blueprints overviewAndroid architecture blueprints overview
Android architecture blueprints overview
 
Devoxx
DevoxxDevoxx
Devoxx
 
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...
Chapter 3.pptx Oracle SQL or local Android database setup SQL, SQL-Lite, codi...
 
Memento Pattern Implementation
Memento Pattern ImplementationMemento Pattern Implementation
Memento Pattern Implementation
 
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
 
Building Reactive Microservices with Vert.x
Building Reactive Microservices with Vert.xBuilding Reactive Microservices with Vert.x
Building Reactive Microservices with Vert.x
 
JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)
 
React - An Introduction
React - An IntroductionReact - An Introduction
React - An Introduction
 
Vertx SouJava
Vertx SouJavaVertx SouJava
Vertx SouJava
 
Vertx daitan
Vertx daitanVertx daitan
Vertx daitan
 
Windows 8 for Web Developers
Windows 8 for Web DevelopersWindows 8 for Web Developers
Windows 8 for Web Developers
 

Más de e-Legion

Más de e-Legion (13)

MBLTDev15: Alexander Dimchenko, DIT
MBLTDev15: Alexander Dimchenko, DITMBLTDev15: Alexander Dimchenko, DIT
MBLTDev15: Alexander Dimchenko, DIT
 
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank
MBLTDev15: Anna Mikhina, Maxim Evdokimov, Tinkoff Bank
 
MBLTDev15: Ivan Kozlov, Aviasales
MBLTDev15: Ivan Kozlov, AviasalesMBLTDev15: Ivan Kozlov, Aviasales
MBLTDev15: Ivan Kozlov, Aviasales
 
MBLTDev15: Ilya Krasilshchik, Meduza.io
MBLTDev15: Ilya Krasilshchik, Meduza.ioMBLTDev15: Ilya Krasilshchik, Meduza.io
MBLTDev15: Ilya Krasilshchik, Meduza.io
 
MBLTDev15: Svetlana Sonina, STS Media
MBLTDev15: Svetlana Sonina, STS MediaMBLTDev15: Svetlana Sonina, STS Media
MBLTDev15: Svetlana Sonina, STS Media
 
MBLTDev15: Marius Racwitz, Realm
MBLTDev15: Marius Racwitz, RealmMBLTDev15: Marius Racwitz, Realm
MBLTDev15: Marius Racwitz, Realm
 
MBLTDev15: Denis Legezo, Kaspersky Lab
MBLTDev15: Denis Legezo, Kaspersky LabMBLTDev15: Denis Legezo, Kaspersky Lab
MBLTDev15: Denis Legezo, Kaspersky Lab
 
MBLTDev15: Kyle Fuller, Apairy
MBLTDev15: Kyle Fuller, ApairyMBLTDev15: Kyle Fuller, Apairy
MBLTDev15: Kyle Fuller, Apairy
 
MBLTDev15: Sergey Semenov, Trucker Path
MBLTDev15: Sergey Semenov, Trucker Path MBLTDev15: Sergey Semenov, Trucker Path
MBLTDev15: Sergey Semenov, Trucker Path
 
MBLTDev: Phillip Connaughton, RunKepper
MBLTDev: Phillip Connaughton, RunKepper MBLTDev: Phillip Connaughton, RunKepper
MBLTDev: Phillip Connaughton, RunKepper
 
MBLT15: Alexey Chikov, Kaspersky Lab
MBLT15: Alexey Chikov, Kaspersky LabMBLT15: Alexey Chikov, Kaspersky Lab
MBLT15: Alexey Chikov, Kaspersky Lab
 
MBLT15: Yakov Zubarev, Parallels
MBLT15: Yakov Zubarev, ParallelsMBLT15: Yakov Zubarev, Parallels
MBLT15: Yakov Zubarev, Parallels
 
MBLT15: Dmitriy Navosha, Sports.ru
MBLT15: Dmitriy Navosha, Sports.ru MBLT15: Dmitriy Navosha, Sports.ru
MBLT15: Dmitriy Navosha, Sports.ru
 

Último

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Último (6)

Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
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
 
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
 
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
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 

MBLTDev15: Cesar Valiente, Wunderlist