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.

302<br />

Sunday Afternoon<br />

Web technologies on an implementation Class diagram<br />

Sometimes you may wish to show JSP pages, servlets, HTML content, JavaScript, and other<br />

Web technologies on a Class diagram. Figure 29-7 shows some ways you can include these<br />

technologies on a Class diagram. Servlets are regular classes in Java, so they can be shown<br />

normally on the Class diagram. JSP pages are represented by servlets, so you could simply<br />

represent the servlet class that is generated from the JSP page. In the Class diagram, I chose<br />

to show the JSP page without detailing any attributes or methods. The servlets don’t have<br />

an association with the JSP pages, but they have a dependency based on the fact that they<br />

redirect the HTTP request to the JSP page. The diagram also shows that the JSP page builds<br />

the HTML page and that the HTML page contains an HTML form and some JavaScript. Each<br />

of the classes has a stereotype to show what kind of technology it is.<br />

WiredWebController<br />

doGet(request:<br />

HttpServletRequest, response:<br />

HttpServletResponse): void<br />

doPost(request:<br />

HttpServletRequest, response:<br />

HttpServletResponse): void<br />

<br />

<br />

Appointment<br />

QueryForm<br />

<br />

<br />

Appointment<br />

QueryForm<br />

QueryForm<br />

+ startDate: input-Textfield<br />

+ endDate: input-Textfield<br />

+ contact: input-Textfield<br />

+ highPriority: input-checkbox<br />

<br />

<br />

No<br />

Appointments<br />

<br />

<br />

Appointment<br />

QueryResults<br />

<br />

DataVerification<br />

verify()<br />

Figure 29-7<br />

<strong>UML</strong> Class diagram with Web technologies<br />

XML<br />

Although only a few years old, XML has become extremely popular and is being used for<br />

data transfer in more and more systems. XML is an excellent way to transfer data between<br />

systems. An XML document holds data that is being stored or transferred. XML documents<br />

can be validated with an XML schema or DTD. (For simplicity, I won’t go into the distinction<br />

between the two; instead, I will just use schema.) The schema defines the rules for all<br />

documents of a certain type. Thus, the relationship of schemas and documents is like the<br />

relationship of a <strong>UML</strong> Class diagram and an Object diagram. An Object diagram shows a set<br />

of objects that follow the rules and relationships defined on a Class diagram. Likewise, an<br />

XML document has a set of data that follows the rules and relationships defined by the XML<br />

schema. An XML schema can specify what data will be stored in the documents, the structural<br />

associations between the data, the multiplicities of how many of one type of data<br />

entities are associated to another type, and the types of the data.<br />

The advantages of using XML include:<br />

XML is a simple and effective way to store data.<br />

Validation tools can automatically validate an XML document against a schema.<br />

Parsing tools can automatically parse the data out of an XML document.<br />

Schemas allow you to standardize the structure of the data so that a whole industry<br />

can agree to share data in one standard format.

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

Saved successfully!

Ooh no, something went wrong!