background image
<< Types of Messages | Using Objects >>
<< Types of Messages | Using Objects >>

Naming Conventions

Product Overview
Naming Conventions
Messages can be identified by a name or operation signature.
Type
Example
Description
Name
// Get the Password
A name identifies only the name of the message.
Simple names are often used in diagrams
developed during analysis because the messages
are identified by their responsibilities and not
operations. One convention uses double slashes
(//) to indicate that the stimulus name is not
associated with an operation.
Signature
getPassword(String)
When an operation is assigned to a message, you
can display the operation signature to identify the
name of the operation and its parameters.
Signatures are often used in diagrams developed
during design because the provide the detail that
developers need when they code the design.
Objects
An object is a model element that represents an instance of a class. While a class
represents an abstraction of a concept or thing, an object represents an actual entity.
An object has a well-defined boundary and is meaningful in the application. Objects
have three characteristics: state, behavior, and identity. State is a condition in which
the object may exist, and it usually changes over time. The state is implemented with
a set of attributes. Behavior determines how an object responds to requests from
other objects. Behavior is implemented by a set of operations. Identity makes every
object unique. The unique identity lets you differentiate between multiple instances
of a class if each has the same state.
The behaviors of objects can be modeled in sequence and activity diagrams. In
sequence diagrams, you can display how instances of different classes interact with
each other to accomplish a task. In activity diagrams, you can show how one or more
instances of an object changes states during an activity. For example, an e-commerce
application may include a "Cart" class. An instance of this class that is created for a
customer visit, such as "cart100:Cart." In a sequence diagram, you can illustrate the
stimuli, such as "addItem( )," that the "cart100:Cart" object exchanges with other
objects. In an activity diagram, you can illustrate the states of the "cart100:Cart"
object, such as empty or full, during an activity such as a user browsing the online
catalog.
Shape
In sequence and activity diagrams, an object appears as a rectangle with its name
underlined. In sequence diagrams, a lifeline (a dashed, vertical line) is attached to the
15