next up previous contents
Next: Sequence Diagrams Up: Lecture 2: Classes, Objects, Previous: Sequences, Collaborations, Activities, States

Commentary

Interaction diagrams describe object behaviour in interactions between objects in a running system. They provide the dynamic modelling in analysis and design (both what & how) of the system by describing how objects cooperate to manage tasks performed by the system. These tasks achieve the system services (use cases)for its users. Communication between objects in the system takes place in the form of message passing between them. Message passing amounts to operation calls by objects. This will cause state changes of the calling object and the called object.

A sequence diagram describes how different objects send and receive messages as time progresses in an orderly manner in order to provide a system service to the user. As a consequence of an object receiving a message an activity takes place causing other messages to be sent to other objects causing a chain of events to take place in subsequent times. The result of such a chain of events occurring is a particular task to be performed by the system for the user. A sequence diagram describes this sequence of events to do the work required for achieving the user task.

A collaboration diagram describes the chain of activities as objects interact with each other. The emphasis is on the message passing links between objects, and the order in which these links are established. What is important is the object context, i.e., which link is established next. So while sequence diagram emphasises the sequence of events, collaboration diagram emphasises the object linkage sequence.

An activity diagram describes the successive activities that take place when the system performs a user service. This flow of activities is done by interactions between the objects in the system. The order of these activities describes the sort of actions that objects do to accomplish the user service. A bit like flow chart showing the sequence of activities.

A state diagram describes the different possible states of an object during its life time and how transitions take place from one state to another due to events that occur. For example, an invoice object will go from an unpaid state to a paid state when the payment event takes place.

Depending on the application some interaction diagrams are more useful than others. Sequence and Collaboration diagrams are semantically equivalent. AlsoState and Activity diagrams are related the former being concerned with sequence of events and the latter with sequence of activities. The purpose of dynamic modelling is to study the runtime behaviour of the system from the point of view of the messages being passed between objects to achieve the services (use cases) and to ensure that the static model class diagram has this behaviour. This has the effect of refining the static model by including new classes and removing or changing classes that were introduced in earlier iterations on purely structural grounds. Study of interactions between objects in dynamic models determine the class operations more precisely. Due to the many system services (use cases) there may be many dynamic models that all correspond to the same static model.


next up previous contents
Next: Sequence Diagrams Up: Lecture 2: Classes, Objects, Previous: Sequences, Collaborations, Activities, States
Ananda Amatya
11/3/1999