In recent days, the technologies have started to emerge quickly with the latest innovations and older computing methods are getting back stage in the software development. I believe that one of the software development methods Model-View-Controller (MVC) can become one of most successful architectural pattern for the mobile application development permitting independent development, testing and maintenance at ease as always. Popular in Web application development, MVC is now finding a new age in mobile app development. Despite being decades old, MVC is being applied to the latest trends in software development: Web and mobile applications.
MVC is especially appropriate for Mobile applications. It can typically have a substantially larger number of specifically purposed user interface modules. So the more rigorous attention to mobile development that is implied by good MVC design makes keeping the design more tightly focused on single-purpose units that are consistent in their abstractions and play well together. At the same time, this pattern helps partition functionality into modules that can more cleanly defined with solid coherence while being more precise about limited cohesion where it properly belongs.
There are few mobile application development frameworks based on MVC pattern available in market. Sencha Touch is a powerful way to build mobile apps, and, because it relies entirely on web technologies, we can easily host those apps on the web server and have users find and access them directly from their mobile browsers. Another one is the M-project that contains all UI and Core files to build jQuery Mobile based mobile HTML5 Apps.
To write mobile application we can think of either of the below cited options to achieve a business need.
- Purely native application using mobile specific development platform and libraries.
- Web based application to address the mobile version of web. In this case HTML5 can play vital role to provide greater capabilities like storage methods, offline cache, etc.
- Hybrid application – developed using Webkit control of mobile platform to render the view using HTML and platform specific APIs to implement the business logic.
Model
The model can be a collection of Java script objects or platform specific classes that form a software application intended to store, and optionally separate, data. A front end object that can communicate with any user interface (for example: a mobile specific custom control that represents graphical user interface or a web component like HTML).
View
The view can represented either by the HTML/HTML5 components or platform tailored UI controls, with ability to view data being transported to the page in various ways.
Controller
The Controller communicates with the front end of the model and loads view with appropriate data.
We can depict the MVC architecture for above mentioned development methods as show in diagram below.