Page 305 -
P. 305
272 Part 3 • the analysis Process
class, from the parameters passed on the message sent to the class, or as a result of a calculation
performed by the method of the class. The method logic and parameters must be examined to
ensure that the method logic has all the information required to complete its work. Horizontal
balancing is further described in Chapter 7.
Enhancing Sequence Diagrams
Once a class diagram is drawn, it may be desirable to go back to the sequence diagram and include
special symbols for each of the different types of classes introduced in the last section. Sequence
diagrams in particular can be overbearing if an analyst doesn’t have a systematic approach to
drawing them. The following steps are a useful approach to enhancing a sequence diagram:
1. Include the actor from the use case diagram in the enhanced sequence diagram. This will
be a stick figure from the use case diagram. There may be an additional actor on the right
side of the diagram, such as a credit card company or bank.
2. Define one or more interface classes for each actor. Each actor should have his or her own
interface class.
3. Create prototype web pages for all human interfaces.
4. Ensure that each use case has one control class, although more may be created during the
detailed design. Look for that control class and include it in the sequence diagram.
5. Examine the use case to see what entity classes are present. Include these on the diagram.
6. Realize that the sequence diagram may be modified again when doing detailed design, such
as creating additional web pages or control classes (one for each Web form submitted).
7. To obtain a greater degree of reuse, consider moving methods from a control class to an
entity class.
A Class Example for the Web
Classes may be represented using special symbols for entity, boundary (or interface), and control
classes. These are called stereotypes, an extension to UML, which are special symbols that may
be used during analysis, but are often used when performing object-oriented design. They give
an analyst freedom to play with the design to optimize reusability.
The different types of classes are often used when working in the systems design phase.
Figure 10.15 is an example of a sequence diagram representing a student viewing his or her
personal and course information. In the diagram, :View Student User Interface is an exam-
ple of an interface class; :Student, :Section, and :Course are examples of entity classes;
and :View Student Interface Controller and :Calculate Grade Point Average are control
classes.
The student is shown on the left as an actor, and he or she provides a userLogon to the
:View Student User Interface class. This is a Web form that obtains the student’s user ID and
password. When the student clicks the Submit button, the Web form is passed to the :View
Student Interface Controller. This class is responsible for the coordination of sending mes-
sages and receiving returned information from all the other classes.
The :View Student Interface Controller sends a getStudent( ) message to the :Student
class, which reads a database table and proceeds to return the studentData.
The studentWebPage is returned to the :View Student User Interface. which displays
the information in the Web browser. At the bottom of the page is a nextButton that the stu-
dent clicks to view courses. When the user clicks this button, it sends a Web form to the :View
Student Interface Controller. This form contains the studentNumber(), sent along with the
studentWebPage, and is used to send a message to the :Section class to obtain the section grade.
If the studentNumber() was not automatically sent, it would mean that the student would have
to enter his or her studentNumber() again, which would not be a satisfactory user interface
because it involves redundant keying. Notice that the :Student class is not involved and that the
focus of control (the vertical bar that is connected to the :Student class) ends before the second
set of activities (the horizontal arrows pointing to the right) begins.
The :View Student Interface Controller class sends a getSection() message to the :Section
class, which returns a sectionGrade. The :Section class also sends a calculateGPA() message
to the :Calculate Grade Point Average class, which sends a message back to the :Course class.