MVC multi-tier mobile application

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 14:41:55

After working a little bit more with the MVC pattern and reading many references, most of them from questions here in SO I think I can give an answer like this:

The MVC pattern is a logical separation of concerns between the components of an application. The 3-tier architecture achieves separation of concerns between the Data, the Application processing, and the Presentation but it also implies a physical separation since it is in essence a server-client architecture.

Both techniques can be used simultaneously since they can be seen as complementary.

Since the MVC pattern is a logical separation it is quite possible to have different parts of the Model in different physical locations. The same goes for the Controller, you can have different pieces of the Controller in the Mobile Device as well as in the server. All of your views are in the device.

Here's a summary of how the two techniques can be applied for developing a Server-client Mobile Application

Model

The Model is your data and the rules to modify it, that means that part of your model is in the Application processing tier. The data can be local, i.e., stored in the device which means it is in the Presentation tier or it could be remote such as in a DB and all the intermediate objects that represent which are in the Data tier.

View

The View is in the Presentation tier. This is the actual User Interface that lives on the device.

Controller

The Controller can also be distributed physically in the client and the server. This is all the code that either receives notifications from the Model and updates the View or processes events from the View and uses the Model accordingly. This puts it in the Application processing tier.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!