MVC on Android

Don’t do MVC on Android

Model-View-Controller is absolutely different from MVP and does not solve any problems which interface developers are facing.

What is MVC?

  • Model stands here for internal application state. It can or can not be connected with a storage.
  • View is the only thing that is partially common with MVP – it is a part of an application that renders Model to the screen.
  • Controller represents an input device, such as keyboard, mouse or joystick.

MVC comes from good (probably) and old days when you had a PC and a simple keyboard-driven application such as a game. No windows, no graphical user interface – the application was something that receives input (Controller), maintains some state (Model) and produces output (View). Both: data and control go like this: controller -> model -> view. This pattern is absolutely useless on Android.

There is a lot of confusion with MVC. People believe that they use MVC, while in fact they use MVP (web developers). Many Android developers think that Controller is something that is controlling View, so they are trying to extract View logic out of View to create a thin View that is controlled by a dedicated Controller. I personally do not see any benefits in such application structure.

Leave a Reply

Your email address will not be published. Required fields are marked *