Module 4#
Sequence Diagrams#
Example Code and its sequence diagram#
Public class A
{
Private BB myB = new BB();
Public void doOne()
{
myB.doTwo();
myB.doThree();
}
}
![Pasted image 20220219112604.png](../../../Assets/Pasted%20image%2020220219112604.png)
Sequence diagram for payment system#
Sequence vs Communication#
- UML tools usually emphasize sequence
- Easier to see call flow sequence—read from top to bottom
- Communication diagrams are more space-efficient
- Communication Diagrams expand top to bottom; Sequence Diagrams expand left to right
Common Notation#
Singleton Objects#
- Only one instance of the class instantiated at any time
Lifeline Boxes#
- Lifeline is a dashed line below the object that creates a shortlived object
Messages#
Reply or Returns#
- Use the message syntax
returnVar=Message(parameter)
- Using a reply or return message at the end of an activation bar
Messages to self#
- We use a nested activation bar to satisfy this
Condition and looping#
Other frame operators#
Relating interaction diagrams#
- Interaction occurances is a reference to an interaction within another interaction
Polymorphic Messages#
Communication Diagrams#
- Connection path between objects. Navigation and visibility. Instance of an association.
- Multiple messages and messages both ways
Creation of instances#
Sequencing#
Conditional Messages#
Mutually Exclusive Conditions#
Iterations#
Design Class Diagrams#
- During analysis emphasize domain concepts
- During design shift to software artifacts
- UML has no explicit notation for DCDs
- Uniform UML notation supports smoother development from analysis to design
Domain model vs design class diagram#
Developing DCD for POS DCD#
Adding dependencies:#
An instance of product description is used by a method in the sale class making sale dependent on the product description.:
Composition (Whole part) relationship#
an aggregation is shown with a hollow diamond instead of a fully coloured one.
Association Classes#
Interfaces and template classes#
Tags: !OOADIndex