Web Application Engineering

Project Management & Design

Cristian Lucchesi

Istituto di Informatica e Telematica - CNR

Caratteristiche Modello evolutivo

Sviluppo iterativo e incrementale

Modello evolutivo

Fasi del Modello Evolutivo

Configuration e project Management

Trac

Object orientation

Object Oriented Design

Bruce E.Wampler - The Essence of Object Oriented Programmin with Java and UML

Analisi degli oggetti

Fasi:

Analisi degli oggetti (cont)

Identificazione delle classi:

Analisi degli oggetti (cont)

Criteri di eliminazione delle classi:

Analisi degli oggetti (cont)

Identificazione delle associazioni tra le classi

Analisi degli oggetti (cont)

Identificazione degli attributi

Analisi degli oggetti (cont)

Ereditarietà

Analisi degli oggetti (cont)

Procedimento iterativo

Analisi degli oggetti (cont)

Risultato dell'Analisi degli Oggetti

UML in due righe

Viste UML

Diagramma delle classi

Diagramma delle classi di esempio del Hotel Booking

Pattern

Pattern software

Categorie Pattern

Ruolo dei pattern

Model View Controller (MVC)

Wikipedia
Model-view-controller (MVC) is an architectural pattern used in software engineering. In complex computer applications that present lots of data to the user, one often wishes to separate data (model) and user interface (view) concerns, so that changes to the user interface do not affect the data handling, and that the data can be reorganized without changing the user interface. The model-view-controller solves this problem by decoupling data access and business logic from data presentation and user interaction, by introducing an intermediate component: the controller.

Model View Controller (MVC) (cont)

MVC simple diagram

Model View Controller (MVC) (cont)

MVC: partecipanti e responsabilità

MVC: partecipanti e responsabilità (cont)

MVC - Model 2 in Java

Diagramma UML MVC Model 2 in Java

MVC - Model 1 in Java

Diagramma UML MVC Model 1 in Java

MVC: Vantaggi e Svantaggi

Vantaggi
ri-uso dei componenti del modello
la separazione di model e view permette a molte view di usare gli stessi oggetti del modello
i componenti del modello sono più facilmente implementabili, testabili e mantenibili perché ogni accesso ai dati del modello passano da questi componenti
più facile supporto per nuovi tipi di client
per supportare un nuovo tipo di client è sufficiente scrivere nuove view e alcuni controller utiilizzando i soliti oggetti del model
Svantaggi
aumento della complessità dell'architettura
questo pattern introduce alcune classi aggiuntive dovuto alla seperazione tra model, view e controller

MVC: vari tipi di utenti

MVC e vari tipi di utenti

Framework

Scrivere le applicazioni Web

Ci sono molti Web application framework che permettono di:

Java MVC Frameworks

PHP MVC frameworks

Post/Redirect/Get

(PRG) is a common design pattern for web applications, to help avoid duplicate form submissions and allow applications to behave more intuitively with browser bookmarks and the reload button.
After a web user submits a form to a server, the server typically generates an HTML page as a response. To the user, this looks like an ordinary web page, but because it was generated by an HTTP POST request, it cannot be bookmarked, and attempting to reload/refresh the page in the browser could cause the form information to be resubmitted, possibly with unexpected results (such as a duplicate purchase).
To avoid this problem, many web applications use the PRG pattern - instead of returning an HTML page directly, the POST operation returns a redirection command (using the HTTP 303 response code (sometimes 302) together with the HTTP "Location" response header), instructing the browser to load a different page using an HTTP GET request. The result page can then safely be bookmarked or reloaded without unexpected side effects.

Riferimenti

The end

Grazie
per
l'attenzione