Modeling Flows of Control by Time Ordering
To model a flow of control by time ordering:
- Decide what interaction to be modeled; whether it is a system, subsystem, operation, or class, or one scenario of a use case or collaboration
- Analyze the objects that take part in the interaction
- Represent them on a left to right sequence diagram. The more important objects go from the left until right end
- Set the lifeline for each object
- Set appropriate lifelines for objects created or destroyed during the interaction. Also clearly indicate their birth and death with stereotyped messages
- Initiate the interaction with a message. Show each subsequent message with their properties (parameters) from top to bottom wherever necessary
- In order to visualize the nesting of messages or the different points in time during the computation, enhance each object's lifeline with its focus of control
- Enhance each message with a timing mark and add suitable time or space constraints (if it is necessary)
Model Flows of Control by Organization
To model a flow of control by organization:
- Decide what interaction to be modeled; whether it is a system, subsystem, operation, or class, or one scenario of a use case or collaboration
- Analyze the objects that play a role in the interaction
- Display them on a collaboration diagram in a graph as vertices
- The more important objects are placed in the centre of the diagram and their neighboring objects to the outside
- Specify the links among these objects. The association links come first
- The other links must be shown next. Enhance them with suitable path annotations (global and local) to clearly specify how these objects are related to each other
- Starting with the message that initiates this interaction, connect each subsequent message to the appropriate link. Also, set its sequence number as appropriate
- Represent nesting by using denwey decimal numbering
- Enhance each message with a timing mark, and add suitable time or space constraints (if necessary)
Forward and Reverse Engineering
Forward Engineering
Forward engineering is applicable to both sequence and collaboration diagrams, exclusively if the context of the diagram is an operation.
public void register() {
CourseCollection courses = getSchedule();
for (int i = 0; i < courses.size(); i++)
courses. item (i) .add(this);
this.registered = true;
Reverse Engineering
Reverse engineering is also possible for both sequence and collaboration diagrams. Completely possible if the context of the code is the body of the operation.