Sequence Diagram   «Prev  Next»
Lesson 6 Interfaces
Objective Convert events to operations.

Complete the event description

Complete the event description by adding information that is passed along with the event and the expected answer or response. Both of these elements are optional, that is, not every event requires parameters and not every event requires a response.
For example, an event called "notify" from one context might be as simple as an alarm with no parameters and no return. In another context, "notify" might mean "send a message and wait for a reply."

Convert event descriptions to operations

The goal of creating the sequence diagram is to discover and document the interfaces of each class. To define each interface fully, you must convert the event description to a formal operation signature.
The standard definition for an operation signature consists of a name, input parameters (or arguments), the expected return data type, and constraints.

Events and Operations
  1. Operation name: Required
  2. Any number of arguments is allowed
  3. Return data type: Required for a return value, but return values themselves are optional
  4. Visibility: Required before code generation
  5. Class operation: Optional
  6. Argument name: Required for each argument, but arguments themselves are optional
  7. Argument data type: Required for each argument, but arguments themselves are optional
  8. Constraints: Optional

Interfaces Define Operation
Keep in mind that:
  1. Arguments (or parameters) are data elements that the object needs in order to perform the operation.
  2. The return data type describes the kind of information that must be given as a result of completing the operation.,
  3. Constraints are simply free-form text describing rules and limitations on the performance of the operation.
1) Source event description, 2) Operation description elements
1) Source event description 2) Operation description elements