What’s the difference between web MVC and desktop/mobile MVC?

Asked

Viewed 631 times

10

Apparently the MVC model as employed in the web (Rubyonrails, Cakephp, etc.) is different from MVC as employed in desktop/mobile (Delphi, Android, etc). No desktop it seems to be more connected to the interface than in the web.

  • What is the difference between the two variants?
  • Theoretically it is possible to use MVC as it is used in web in the desktop (separately creating model classes, controllers and windows). This is recommended?
  • Different in what senses?

  • @gmsantos Differences in their implementations and how to work with them. See: http://answall.com/q/22399/7261

1 answer

9


Consider the image:

MVC

She describes the relationship between the parties in the MVC model.

Note the arrow notification.

MVC for desktop/mobile

In the version desktop/mobile that works where Model, Vision and Controller are in the same environment it is possible for the Model to easily notify Change View.

It is, indeed, advisable to follow this division. In fact, it is often a process of discipline to use tiering in desktop applications because one can easily circumvent any layer without many immediate consequences, besides the chaos that the code becomes over time.

For example, not using a Controller to properly manage the actions performed by the user and the updates in Vision usually leads to "spaghetti logic", ie the one where we never know properly what the state of the system and what can occur if the user takes an action "unexpected".

I will not dwell on the details of implementation because it is not my specialty and would greatly lengthen the answer.

MVC for web

In the version web, due to the nonpersistent connection feature of the HTTP protocol and most web servers, the Model generally cannot notify the View unless a new request is made by the user or some agent in the client.

This scenario may change when using technologies like Websockets or some equivalent mechanism, as in the case of the notifications here in the OS, but it is something that, let’s say, still eludes the rule.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.