Notations

Class-Responsibility-Collaborator Cards

Class-Responsibility-Collaborators (CRC) cards [BeCu89] help to identify and specify objects or the components of an application in an informal way, especially in the early phases of software development.

A CRC-card describes a component, an object, or a class of objects. The card consists of three fields that describe the name of the component, its responsibilities, and the names of other collaborating components. The use of the term ‘class’ is historical [Ree92]—we also use CRC cards for other types of components or even single objects.

UML Class Diagrams

The Unified Modeling Language (UML) [BRJ98] is a widely-used object-oriented analysis and design method. An important type of diagram within UML is the class diagram. A class diagram describes the types of objects in a system and the various types of static relationships that exist among them.

As an extension to the standard UML notation we introduce a symbol to indicate that instances of a class run in separate threads.

Class. A rectangular box, denoting the name of the class and optionally its attributes and operations. Abstract classes names are labeled in italics along with their corresponding abstract methods.

Operation. Operation names are written in the class boxes. They denote the methods of classes. Abstract operations, that is, those that only provide the interface for polymorphism, are denoted by italics.

Attributes. Attribute names are written in the class boxes. They denote the instance variables of a class.

Association. A line that connects classes. Associations can be optional or multiple. A number at the end of an association denotes its cardinality. Association of classes is used to show any type of class relationship except aggregation, composition and inheritance.

Aggregation. A hollow diamond shape at the termination of an association line denotes that the class(es) at the other end of the association are used by the class.

Composition. A solid diamond shape at the termination of an association line denotes that the class(es) at the other end of the association are part of the class and have the same life-time.

Navigability. Navigability denotes a directed association.

Dependency. A dependency indicates that a class uses the interface of another class for some purpose.

Realization. A realization represents the relationship between a specification and its implementation.

Inheritance. Inheritance is denoted by a triangle at the top of an association line. The apex of the triangle points to the superclass.

Templates. Parameterized classes are declared by attaching a dashed rectangular box to a class box, which includes the class’ template parameters.

Thread. A wavy line attached to a class indicates that instances of this class run in separate threads. The thread symbol is an extension to the UML class diagram notation, which lacks an effective way to denote multi-threading.

UML Sequence Diagrams

UML sequence diagrams describe how groups of objects collaborate in some behavior [BRJ98]. The notation is based on the Object Message Sequencing Chart (OMSC) notation defined in [POSA1].

In addition to the standard UML notation, however, we also use the notation for illustrating parameter-passing that we specified in our original OMSC definition. This allows us to indicate when the responsibility for an object is passed from one object to another or when an object obtains a reference to another object. As a second extension to standard UML we introduce a special symbol that allows us to label activities initiated by a thread of control rather than a particular UML active object.

Object. An object or component in a sequence diagram is drawn as a rectangular box. The box is labeled with the underlined name of the component in the pattern. An object that sends or receives messages in the sequence diagram has a vertical bar attached to the bottom of the box. Active objects are denoted by thicker lines for the rectangular box.

Time. Time flows from top to bottom. The time axis is not scaled.

Messages. Messages between objects are denoted by arrows. These arrows are labeled with the method name at the head, if applicable. Synchronous messages are indicated by solid full-arrowheads, asynchronous messages by solid half-arrowheads. Returns are indicated by dashed arrows with open arrowheads.

Object Activity. To denote the activity of objects that perform a specific function, procedure or method, rectangular boxes are placed on the vertical bar attached to the object. An object may also send messages to itself to activate other methods. This situation is represented by nested boxes offset slightly to the right.

Parameter. Parameters are only noted explicitly when they are necessary to understand a sequence diagram. Parameters of a message are shown as a box on top of the arrow and return parameters below the returning arrow. If responsibility for a parameter object is passed along the arrow the name of the object is shown in boldface. If only a reference to the object is passed as a parameter, its name is shown in italics. This notation is an extension to UML sequence diagram.

Object Lifecycle. In most cases we assume that all relevant objects already exist, so the corresponding boxes are drawn at the top of the sequence diagram. If a sequence diagram shows object creation, this is denoted by an arrow to a box placed within the sequence diagram. If an object ceases to exist, this is denoted by a cross that terminates the vertical bar. This notation corresponds to constructor and destructor calls in C++.

Thread. A wavy line attached to a time line indicates a thread of control that sends or receives messages. A thread is labeled with the underlined identifier of the thread. The thread symbol is an extension to the UML sequence diagram notation, which allows us to denote activities initiated by any object running in a designated thread of control rather than by a specific active object.

UML Statechart Diagrams

UML statechart diagrams specify the sequences of states that an object or an interaction goes through in response to events during its life, together with its responsive actions [BRJ98]. This book only uses basic state diagram notations.

State. A condition or situation in the life of an object during which it satisfies some condition, performs some activity, or waits for some event. States are denoted by rounded rectangular boxes, labeled with their names. There are two additional states: the initial state, denoted by a black circle, which indicates the entry point into a state machine and the final state, denoted by a hollow circle with a black circle enclosed, which indicates the completion of the state machine.

Composite State. A state that consists itself of a sequence of disjoint substates.

Transition. A relationship within a state machine between two states. A transition indicates that an object in the first state will enter the second state when a specified event such as an action occurs or a condition evaluates to true. If the source and target state are the same the transition is called a ‘self-transition’.

Action. An executable computation, such as a method, that is conceptually atomic with respect to changing the current state.

Condition. A condition is a guard that triggers a transition if it evaluates to true.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.6.194