Page 314 -
P. 314
chaPter 10 • object-oriented systems analysis and design Using Uml 281
Figure 10.21
Activity Department Course Textbook Assignment Exam
A CRUD matrix can be used to
Add Department C help determine what methods are
needed. This CRUD matrix is
View Department R used to determine the methods and
operations for course offerings.
Add Course R C
Change Course R U
Course Inquiry R R R R R
Add Textbook R R C
Change Textbook R RU
Find Textbook R R
Remove Textbook R D
Add Assignment R C
Change Assignment R RU
View Assignment R R
Add Exam R R
Change Exam R RU
View Exam R R
Statechart Diagrams
Using a statechart, or state transition, diagram is another way to determine class methods. It is
used to examine the different states that an object may have.
A statechart diagram is created for a single class. Typically objects are created, go through
changes, and are deleted or removed.
Objects exist in these various states, which are the conditions of an object at a specific
time. An object’s attribute values define the state that the object is in, and sometimes there is an
attribute, such as Order Status (pending, picking, packaged, shipped, received, and so on) that
indicates the state. A state has a name in which each word is capitalized. The name should be
unique and meaningful to the users. A state also has entry and exit actions, the things the object
must do every time it enters or leaves a given state.
An event is something that happens at a specific time and place. Events cause a change of
the object state, and it is said that a transition “fires.” States separate events, such as an order that
is waiting to be filled, and events separate states, such as an Order Received event or an Order
Complete event.
An event causes the transition and happens when a guard condition has been met. A guard
condition is something that evaluates to either true or false and may be as simple as “Click to
confirm order.” It also may be a condition that occurs in a method, such as an item that is out of
stock. Guard conditions are shown in square brackets next to the event label.
There are also deferred events, or events that are held until an object changes to a state
that can accept them. A user keying something in when a word processor is performing a timed
backup is an example of a deferred event. After the timed backup has completed, the text appears
in the document.
Events fall into three different categories:
1. Signals or asynchronous messages, which occur when the calling program does not wait
for a returning message, such as a feature run from a menu.