Com S 362 Lecture Outline ---------------------------------------------------- INTERACTION DIAGRAMS IN UML - In previous lectures, we studied the static relationships in the system. However, dynamic interaction is also important. Interaction diagrams provide a detailed representation of the steps of interaction between entities in a software system that is necessary to fulfill some goal. - key idea: show how entities in the same interact with each other to fulfill the overall responsibility of the system - a number of different types of interaction diagrams > sequence diagram: useful for high-level scenario often useful for emphasizing the order of events in the system. > communication diagram: useful for showing connections between entities. > timing diagram: useful for showing timing constraints between events in the system. Not a UML invention, has been around for ages in the electrical engg. community. > interaction overview diagram: a combination of activity diagram and sequence diagram - Each has unique characteristics -------------------------------------------------- NOTATIONS Things to watch out for: instances are underlined start with a colon |-----------| | :PMSD | (should be underlined) |-----------| classes are not underlined, no colon |-----------| | Math | (not underlined) |-----------| multiobjects (collections) have double boxes |-----------| |-----------| | | :File |-| (should be underlined) |-----------| ------------------------------------------ EXAMPLE COMMUNICATION DIAGRAM | | makePayment(cashTendered) | | | v | |-----------| | :Register | |-----------| | | 1: makePayment(cashTendered) | | | v | |-----------| | :Sale | |-----------| | | | 1.1: create(cashTendered) | | | v | |------------| | :Payment | |------------| ------------------------------------------ SEQUENCE DIAGRAM Example sequence diagram for line and containing points, which shows the sequence of calls/messages events exchanged between entities of the system. |------| |------------| |------------| |:Line | | start:Point| | end:Point | |------| |------------| |------------| | | | moveBy | | | ========>| | moveBy | | | |===============>| | | | | | | | | | | | | | | | moveBy | | |====================================>| | | | | | | | | | | | | | | | | | | | | | |