01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

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.

SESSION<br />

29<br />

Design of a Web Application<br />

Session Checklist<br />

✔ Explaining and illustrating the Model 2 Architecture<br />

✔ Explaining and demonstrating how to use Sequence, Collaboration, and<br />

Class diagrams in Web-application design<br />

✔ Explaining the Java technologies that can be applied to Web development<br />

✔ Explaining how to model XML and other markup languages with <strong>UML</strong><br />

object hierarchies<br />

In the last session, you partially implemented a Web Model View Controller (MVC) design<br />

by separating out the model into JavaBeans and the view into JSPs. This partial implementation<br />

of the MVC pattern provides significant advantages: independent development,<br />

better cohesion, and easier maintainability. For a full MVC architecture, though, you<br />

need to know how to separate out the controller elements as well.<br />

Model 2 Architecture<br />

The Model 2 Architecture was presented by Sun Microsystems in the early versions of the<br />

servlet specification. It is now a popularly used and discussed Model View Controller<br />

architecture for Java Web applications. The Model 2 Architecture is an MVC architecture<br />

that will separate out the controller elements. This architecture is shown in the <strong>UML</strong><br />

Component diagram in Figure 29-1 and the <strong>UML</strong> Sequence diagram in Figure 29-2. The Model 2<br />

Architecture separates the model (JavaBeans) and the view (JSPs) just as you did in the last<br />

session. In addition, it has a single servlet used as the controller. All HTTP requests for any<br />

part of the Web application will be directed to this controller servlet. The servlet will verify<br />

the input data from the HTTP request and call methods on the JavaBeans to update the data<br />

model. The servlet controller will then forward the request on to a JSP that will render the<br />

view. The JSP will access the JavaBeans to get the data that should appear on the Web page.

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

Saved successfully!

Ooh no, something went wrong!