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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

specifies the logics for invoking the action classes, the model objects playing as interfaces towardthe data sources and the business logic.We provide a visual model for easily describing the controller behaviour and the used actionclasses. The visual model can be specified through an online tool implemented on AJAXtechnologies, that allows to design the <strong>di</strong>agrams, to store them on a server, to retrieve them andto generate the basic pieces of the Struts components. We automatically generate the contentsof the struts-config.xml file and the stubs of the action classes from the <strong>di</strong>agram created usingthe model. The advantages of the approach are:simple and quick design of the application model;good overall vision of the application, with a notation <strong>di</strong>rectly referring to the MVCmodels;independent design of the controller flow and of the called action;easy reuse of parts of the application defined in the <strong>di</strong>agram.4.3. Jakarta Struts overviewTo implement the MVC architecture for the generated application we will use the MVC frameworkJakarta Struts. An application framework is a skeleton of an application that can be customizedby the application developer.Struts is an application framework that unifies the interaction of the various components of aJ2EE Web application — namely Servlets, JSP pages, JavaBeans, and business logic — into oneconsistent whole. Struts provides this unification by implementing the Model-View-Controller(MVC) design pattern. Struts provides an implementation of the MVC design pattern for Webapplications. Jakarta Struts is incre<strong>di</strong>bly useful in helping to create excellent Web applications.When you use Jakarta Struts, your applications should work more effectively and have fewerbugs. Just as important, Struts should save you hours and hours of programming and debugging.Jakarta Struts ask the developer to create and configure the controller defining the configurationfile stuts-config.xml and implemententing the Action Class performing the function interfacebetween view and business logic. It is possible to obtain the contents of the file struts-config.xmlin automatic mode by the <strong>di</strong>agram created using model. Action Classes can instead be derivedfrom Action units.4.3.1. Struts architectureThe architecture of Struts provides a wonderful mechanism that, when followed, ensures that theMVC pattern remains intact. Although Struts provides a concrete implementation of theController part of the pattern, as well as provi<strong>di</strong>ng the connections between the Controller andModel layers and between the Controller and View layers, it doesn’t insist on any particular Viewpara<strong>di</strong>gm or require that you construct the Model in a particular way.34

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

Saved successfully!

Ooh no, something went wrong!