The document summarizes the architectural changes made to the Wunderlist app between versions 2 and 3. Version 3 was completely redesigned with a modular layered architecture that is highly decoupled, enables real-time syncing, and is easier to maintain, test, and adapt compared to the previous monolithic structure. The key layers include presentation, sync, SDK, and model layers with defined boundaries and dependencies between the layers.
2. Who is this guy?
Image Placeholder
César Valiente
Android Engineer @Wunderlist (@Microsoft)
FLOSS & Android Google Developer Expert (GDE)
+CesarValiente @CesarValiente
3. - A very nice and good
app.
- Monolithic structure.
- Highly coupled.
- Sync in batch.
- Difficult to test .
Wunderlist 2
4. Wunderlist 3
- Completely redesigned.
- Divided into modules (layers).
- Highly decoupled.
- Real time sync.
- Easier to maintain, test and adapt.
- Easy to understand.
5. PARENTAL ADVISORY
The following architecture is shared between all
Wunderlist platforms!
yes,
iOS, Android, Mac OSX, Web and Windows.
9. • Websocket (real time).
• REST.
• Services
Network
• API data models.
• Serializers/deserializers.
• Interfaces/callbacks.
• Sync and async tests.
API model
SDK
10. 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
13. 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
14. 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
15. 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.
16. 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).
18. Presentation layer
• UI + Android libs and code.
• Maximized decoupling among UI and business
logic.
• Database, sadly, is located here (native SQLite
ddbb).
25. 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/