M. 100 M. 1 Billion 1.5 Tera 4.5 Peta Deezer Editors Countries Dedicated Servers New Albums Each Week Paying Subscribers Titles Playlists Requests Per Day Logs Per Day Bytes
are right now - VIPER - MVVM architecture - Demo application using the new architecture - Why using Reactive Programming can bring you more flexibility
CONTROLLER Fetch data from NETWORK Fetch data from Local Storage Transform the data Persist the data Deliver the data etc. Visual rendering Is stateless Not coupled directly to MODEL Builds the VIEW Navigation Controls the MODEL Handling system events
from the Presenter MODEL VIEW Supervising Controller variation PRESENTER Fetch data from NETWORK Fetch data from Local Storage Transform data Persist data Deliver data etc. Visual representation of MODEL Direct coupling to MODEL through data binding Rendering MODEL data updates Saves state Navigation Delivers MODEL data to the VIEW Controls the MODEL Handling system events Modifies MODEL requests based on system information
the feature scales up It ends up with lots responsibilities and lines of code Decouple more Add more Unit Tests Have a more adaptable and permissive architecture Adapt your architecture for Functional Testing
the VIEW Controls the MODEL Handling system events Modifies MODEL requests based on system information INTERACTOR Controls the Repository Handling system events Modifies Repository requests based on system information Transforms data
was changed in order to render itself. Navigate to a different View onClick...modify the Repository Interactor Repo Modifies the Repo Delivers a new ViewModel Presenter Delivers a new ValueObject DataBinding View Workflow
@NetworkPlaylistRepo private final IPlaylistRepository mNetworkRepository; @LocalPlaylistRepo private final IPlaylistRepository mLocalRepository; @Override public Observable<Playlist> getPlaylist( long id) { … }
@NonNull private final IPlaylistRepository mPlaylistRepository; public PlaylistInteractor( @NonNull IPlaylistRepository playlistRepository) { mPlaylistRepository = playlistRepository; } @Override public Observable<Playlist> getPlaylistObservable( long playlistId) { // add more transformations if needed return mPlaylistRepository.getPlaylist(playlistId); } The interactor can listen to System events like “onConnectionChanged” or “onTrimMemory”