How can I use sequence diagrams to analyse user interactions?

 

When we start to explore our use cases, and want to understand how our application might deliver what the customer wants, we need to investigate the messages passed as objects interact with each other.

 

Sequence diagrams in UML allow us to describe the interactions between entities or objects, over a period of time. All sequence diagrams are read from top to bottom - the lowest part of the diagram occurs at a later time to the top of the diagram.

 

At the simplest level, a sequence diagram will describe the interactions between all of the actors and the system as a whole. The system will be represented as an object.

 

 

Objects

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The diagram above shows a scenario where an object called 'Fred' (of class Customer) is placing an order. The messages that are passed between each object are actually statements from the use cases identified earlier.

 

Or, we can say that behaviour in a use case is identified on a sequence diagram by a message. If we take the trouble to write our use cases correctly, the generation of sequence diagrams will be much easier!

 

Although each of the messages have been numbered, there is currently no convention for how they should be numbered. They might be numbered sequentially, or you could use the number that refers to a particular use case.