-
Notifications
You must be signed in to change notification settings - Fork 599
Architecture Guidelines
The architecture of Mifos android-client is base on the MVP (Model View Presenter ) pattern.
-
View ( UI layer ) : This is where Activities, Fragment , and other UI standard Android component live. It is logic less , It is responsible for displaying the data received from the presenters to the user. It also handles the user interactions like clicks, inputs, spinner element selection and triggers the right action in the Presenter if needed.
-
Presenter : Presenter deals with all logic behind the View, Every actions logic will be in Presenter. Presenter subscribes to RxJava Observables provided by the DataManager. They are in charge of handling the subscription lifecycle, analyzing/modifying the data returned by the DataManager and calling appropriate methods in the View in order to display the data.
-
Model (Data Layer) : This is responsible for retrieving, saving, caching and massaging data. It can communicate with local databases and other data stores as well as with restful APIs or third party SDKs. It is divided in two parts: a group of helpers and a DataManager. The number of helpers vary between project and each of them has a very specific function, e.g. talking to an API or saving data in SharedPreferences. The DataManager combines and transforms the outputs from different helpers using Rx operators so it can: 1) provide meaningful data to the Presenter, 2) group actions that will always happen together. This layer also contains the actual model classes that define how the data structure is. In this project, there are many helper (DatabaseHelper, PrefManager, Retrofit Services).
#Android-Client API Documentation API: https://demo.mifos.io/api-docs/apiLive.htm