9. The benefits of WebMVC - notafrancescodavid/webmvcframework GitHub Wiki

// to do

Since its introduction, thanks to the work of Trygve Reenskaug on the MVC pattern for GUI software design, the pattern suggested the decoupling of model and view. In this way, it is possible to associate different views to a given model and display the same data in alternative formats or different devices. Since then, the technologies are changing but the MVC pattern remains valid and new considerations can be made when the pattern is used in the Web. In general, there are two kinds of advantages deriving from the use of the MVC pattern for the development of complex web applications: technical and organizational.

In the next section, an example is shown that emphasize how technical advantages can be obtained using the pattern MVC. The example changes the HelloWorld code that sends a hello message to a list of people in order to run the same application on different kind of devices. It follows a discussion about the organizational advantages deriving from the use of an MVC pattern to develop Web applications.

HelloWorld mobile version

// to do codice di hello worls a 4 persone su dispositivo mobile

Organizational benefits

In general, organizational benefits usually derive from a better organization of work through specialization and coordination. Specialization concerns the division of a work into smaller parts and their assignment to specialized workers. This is a standard practice in modern software development methodologies where the work can proceed in parallel in relatively little increments assigned to software developers and testing activities can be pursued as soon as possible. However, the specialization that comes from the division of work also requires coordination because what has been broken by specialization (subsystem decomposition) has to be reconducted to unity by coordination (system integration).

The advantages deriving from the division of work are evident also when we decide to use the MVC architectural pattern. The technologies used in each subsystem are homogeneous (e.g. HTML and Javascript for the View part, PHP for the Controller part and PHP / SQL for the Model part). The code reflects the separation of the professional skills necessary to deal with the various aspects of development as shown in table 6.1. The code is easier to design, implement, verify and maintain, and you can use pre-existing code where appropriate. The same information can be presented in several ways (e.g. textual/graphics) and on different devices. Note that the controller assumes the role of coordinator of view and model and this easy the system integration activity necessary to build a software system perceived as a unity.

Table 6.1. Separation of skills and technologies for the development of Web MVC applications.