is MVC – Model View Control • Android provide MVC by default • Controller is tightly coupled with view. Each action is correlated to call of Controller with view action. • What is MVVM – Model View View-Model • Model –business rules • View- layout • ViewModel- Bridge for model and view • Avoided as its newly introduced and binding is still not supported in some views
responsible to act as the middle man between view and model. It retrieves data from the model and returns it formatted to the view. • The View • The view-interface, usually implemented by an Activity (it may be a Fragment, a View depending on how the app is structured), will contain a reference to the presenter. It will be responsible for creating the presenter object. The only thing that the view will do is calling a method from the presenter every time there is an interface action (a button click for example). • The model • Model would only be the gateway to the domain layer or business logic. The model would probably be an interactor that implements a use case.
Handle the flow to and from the entities • InterfaceAdapter • This is a set of the adapter converts data from the format most convenient for the usecase and entities(Presenter and controllers belong here) • Framework and Drivers • Contains all the detail related to the app. UI, Framework and database etc.
• That can also be functionally tested by Junit or Mockito • This layer is not related to app business rules and it is decoupled • This layer can be used any app Entities Layer (Framework Module)
or Fragment or View life cycle • Fragment and Activities are only views in over case • Strongly connected to Android SDK • Integration testing, UI tests • Tools: Espresso, Robotium or Roboletic Presentation layer (app module)