13.07.2015 Views

Thesis full text PDF - Politecnico di Milano

Thesis full text PDF - Politecnico di Milano

Thesis full text PDF - Politecnico di Milano

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Action unitAction units are the most important elements of the model and effectively realize the Controller.Action units specify the way in which the application reacts to the user input: the correct Actionunit is called based on the controller decision, and then it processes the user requests, byretrieving data and/or calling the business logic, and provides the information for buil<strong>di</strong>ng theresponse to the user. The Action unit behaviour must be defined completely by the developer. AnAction unit can be linked to a JSP page that shows its results or can be connected to anotherAction unit for performing further processing (possibly based on the results of the first unit).JSP pageJSP pages represent the View of the model. Each JSP page corresponds to a page in the finalWeb application and allows to present contents to the user. The JSP page must be defined by thedeveloper using any sort of e<strong>di</strong>ting tool. JSP pages interact with Action units through links. TheJSP page receives the content to be shown in the page. The JSP page can call Action units andsend it some parameters.Form unitForm units must be connected to an Action unit and represent the user input from one or moreform fields. In this way, Action units can receive the user input coming from the pages of theview.JSP fragmentJSP fragments are portions of reusable code that can be embedded in JSP pages. The mainadvantage of this primitive is to provide modularization and reusability to the designer. Noticethat JSP fragments cannot have input links.Connection LinkConnection Links allow the developer to define the control flow of the application. A control flowis a <strong>di</strong>rected arc represented with an arrow from the source to the destination. It can connect: (i)a JSP page to an Action unit or to another JSP page; (ii) an Action unit to a JSP page or toanother Action unit. A link can carry content objects and parameters. Two variants of theConnection Links are used for specifying the outcome of a control unit: Success Links are shownwith a green arrow; Failure Links are shown as red arrows. After its execution, the Action unitwill follow the success path or the failure path depen<strong>di</strong>ng on a Boolean obtained results. After theexecution of the business logic the Action unit can call the success path or the failure pathevaluating the obtained results. A path can be a JSP page but also another Action unit.Containment LinkContainment Links are used to include Form units into Action units and JSP fragments into JSPpages. This type of link establishes a relation of containment between the two units. For example40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!