lecture_7Sp2011 - Computer Software Engineering Computer...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Computer Software Engineering Computer Spring 2011 Lecture # 7 Object oriented Design Object UML Interaction Diagrams (Sequence, Collaboration and State Chart Diagrams) Sequence Diagram A sequence diagram provides a detailed view of a sequence use case. It shows an interaction arranged in a sequence over It time. time. It helps document the flow within the application. In a comprehensive software system, the sequence In diagram can be quite detailed, and can include thousands of messages. thousands 02/26/12 2 02/26/12 Elements of the Sequence Diagram Elements Objects appear along the top margin Each object has a life line , a dashed line that Each represents the life of the object represents A focus of control- is a tall, thin rectangle that focus sits on top of an object’s lifeline sits Messages that show the actions that objects Messages perform on each other and on themselves. perform 02/26/12 02/26/12 3 Sequence Diagram Basics Object 1 Object 2 Object 3 message() Message Self-Call Activation Box Return Deletion 02/26/12 02/26/12 X Lifeline 4 Security System Example Homeowner system ready Control Panel System enters passcode initiates beep beep sounded ready for activation selects stay/away (de)/activate sensors sensors (de)/activated request light on light on ready for next action 02/26/12 02/26/12 5 Benefits of using UML Sequence Benefits Diagrams Diagrams Allow the software engineer to flesh out details before Allow implementation. implementation. Useful tools to find architectural, interface and logic Useful problems early in the design process. Allows software engineer to validate architecture, Allows interfaces, and logic by exploring how the system architecture would handle different basic scenarios and special cases. It forces the software engineer to think about details It such as interfaces, states, message order, assignment of responsibilities, and special/error cases ahead of time. time. 02/26/12 02/26/12 6 Benefits of using UML Sequence Benefits Diagrams (continues) Diagrams Valuable collaboration tools during design meetings Valuable because they allow software engineer to discuss the design in concrete terms. To document the dynamic view of the system design To at various levels of abstraction, which is often difficult to extract from static diagrams or even the complete source code. Can abstract much of the implementation detail and Can provide a high level view of system behavior. provide 02/26/12 02/26/12 7 Collaboration Diagrams UML collaboration diagram is a UML diagram, that focus on the organization of the objects that participate in a given set of messages. set They show objects and messages, but They no lifelines or focus of control rectangles. rectangles. 02/26/12 02/26/12 8 Collaboration Diagrams Collaboration Continues.. Continues.. A collaboration diagram is another type of collaboration interaction diagram. Like a sequence diagram, it shows how a Like group of objects in a use case work with one another. Each message is numbered to document Each the order in which it occurs. 02/26/12 02/26/12 9 Collaboration Diagrams Collaboration 02/26/12 02/26/12 10 State Chart Diagrams Very similar to those in Structured Analysis Describe the lifecycle of an object – All the possible states of an object – How the object’s state changes as a result of How events that reach the object events Good at describing the behaviour of an object Good across several use cases across Use state diagrams only for classes that exhibit Use interesting behaviour interesting 02/26/12 02/26/12 11 State Chart Diagram Continues.. State Shows the following: –The life history of a given class –The The events that cause a transition from one state to another state –The actions that result from a state change –State State charts are created for objects with significant dynamic behavior significant 02/26/12 02/26/12 12 State Chart Diagram State Example Example Add student[ count < 10 ] Initialization Add Student / Set count = 0 Open Cancel Cancel [ count = 10 ] Canceled Cancel 02/26/12 02/26/12 Closed 13 Summary Use collaboration and sequence diagrams to: Capture the behaviour of a single use case. Capture Show collaborations among objects. Show Use state chart diagrams to: Describe the behaviour of an object across Describe several use cases. several Model 02/26/12 02/26/12 classes that exhibit interesting behaviour. 14 USE CASE Driven… A use case leads to a sequence diagram The sequence diagram is used to allocate The behavior among objects mentioned in the use case. case. This behavior becomes methods These methods becomes operations on the These classes classes 02/26/12 02/26/12 15 What is Next More On UML Class and Sequence Diagrams Continue on the SDD & Implementation 02/26/12 02/26/12 16 ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online