Java Reference
In-Depth Information
sample : Page
test : Head
a title : Heading
title text : Text
body : Body
plain text : Text
a link : Link
link text : Text
Figure 8.7
Analysis of sample HTML document
as intuitive as possible. The class names correspond to the element types
identified above.
The structure of the corresponding class diagram (shown in Figure 8.8 is
isomorphic to the static object structure representing the page. Class
Page
is
the class at the root of the containment hierarchy. It can contain directly
Head
and
Body
. Class
Head
is atomic, i.e. it does not contain any other
element class. On the other hand, class
Body
represents a composed element
and it has a containment relationship with the other three classes:
Heading
,
Text
and
Link
. Both
Heading
and
Link
contain
Text
.
Text
is atomic.
Heading
Page
Head
*
1
1
*
11
*
ordered
1
Body
Text
1
*
*
1
1
*
containment
associations
are ordered
*
1
1
Link
ordered
*
Figure 8.8
Analysis class diagram