MVC multi-tier mobile application

前端 未结 1 1351
走了就别回头了
走了就别回头了 2020-12-12 06:42

I\'m a bit confused about using the MVC pattern. We have a 3-tier architecture: data, middleware, front-end. We are developing an app for iPad which basically does the follo

相关标签:
1条回答
  • 2020-12-12 07:31

    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.

    0 讨论(0)
提交回复
热议问题