MODEL VIEW CONTROLLER Interact with DB Render Model Handle view events Interact with network Manage view state Update model Navigation Interact with system components Handle system events Update view on system events
Model public class CourseModel { Course getFromDatabase() { // fetch from db, or local cache } Course getFromNetwork() { // fetch from apis, cache when possible } }
MODEL VIEW CONTROLLER Interact with DB Render Model Handle view events Interact with network Manage view state Update model Navigation Interact with system components Handle system events Update view on system events
MODEL VIEW CONTROLLER INTERACTOR Retrieve data from DB Render Model Handle view events Interact with external entities Retrieve data from network Manage view state Navigation Forward system events to view Forward model updates to view
MODEL VIEW CONTROLLER INTERACTOR VIEW MODEL Retrieve data from Network Render View Model Handle view events Interact with external entities View state / behavior Retrieve data from network Navigation Update view state
MODEL VIEW PRESENTER INTERACTOR VIEW MODEL Retrieve data from DB Render View Model Handle view events Interact with external entities View state / behavior Retrieve data from network Navigation Update view state
ENTITIES VIEW PRESENTER INTERACTOR VIEW MODEL Get data from Data Sources Render View Model Handle view events Interact with external entities View state / behavior Navigation Update view state
S ingle Responsibility Principle O pen/Closed Principle L iskov Substitution Principle I nterface Segregation Principle D ependency Inversion Principle
CatalogViewModel public final BehaviorSubject catalog = BehaviorSubject.create(); public void subscribeToCatalog(Action1 action) { catalog.subscribe(action); } public void unsubscribeToCatalog() { catalog.unsubscribe(); }