-
Notifications
You must be signed in to change notification settings - Fork 0
Home
#Privvy: The new Android UI architecture
##Overview
Privvy is based off of a popular iOS architecture called VIPER, an acronym for "View Interactor Presenter Entity Router", which in turn was based off of the more platform agnostic MVP architecture. Privvy is basically an anagram of VIPER with a slight twist. In our case it stands for "Presenter Router Interactor View Viewmodel Yoke". While Android doesn't need to address the same exact problems as iOS, the separation of responsibility that VIPER (Privvy) provides holds true regardless of platform.
With Privvy, we can migrate all of our business logic out of our views and unit test it as intended, instead of mixing together our instrumentation and unit tests trying to accommodate monstrous view classes. We can also delegate the acquisition of external dependencies, so that this does not pollute our newly isolated business logic. Finally, we can maintain a single source of truth from the data we acquire, such that our application never enters unpredictable, untestable states. There are 6 types of functional classes and 1 interface to help us achieve this, organized and grouped into their own subcomponents - one of each class/interface in a subcomponent:
- Contract (the interface)
- View
- Presenter
- Interactor
- Router
- ViewModel
- Mapper
It looks like this (sans the Mapper and ViewModel, which are critical, but don't affect the design of the diagram):