Project 2 Phase 1 Submissions 10 Late submissions
Project 2: Phase 1 Submissions • 10 Late submissions 12%. Last year: 10% • 8 No submission 9%. Last year: 14% • Better than project 1 phase 3 submissions – 44 Late submissions 52%. – 11 No submission 13%. F: 7 Students – 4: didn’t work on project 1. 5%
Impact of Class Attendance on Student Performance The bottom 12 percent: 37 absences The top 12 percent: 3 absences
Review: Class Diagrams Aggregation (Shared Association)
Review: Class Diagrams Composition (Not-Shared Association)
Generalization • Indicates that objects of the specialized class (subclass) are substitutable for objects of the generalized class (super-class). – “is kind of” relationship. {abstract} is a tagged value that indicates that the class is abstract. The name of an abstract class should be italicized An abstract class Shape {abstract} Generalization relationship Circle Super Class Sub Class 5
COMP 2710 Software Construction Sequence Diagrams Dr. Xiao Qin Auburn University http: //www. eng. auburn. edu/~xqin@auburn. edu
Purpose of Sequence diagrams • Model interactions between objects • Assist in understanding how a system (i. e. , a use case) actually works • Verify that a use case description can be supported by the existing classes • Identify responsibilities/operations and assign them to classes
Sequence Diagram • Illustrates the objects that participate in a use case and the messages that pass between them over time for one use case • In design, used to distribute use case behavior to classes
Sequence Diagram Syntax
A Sample Sequence Diagram
Two major components in Sequence Diagrams • Active objects • Communications between these active objects – Messages sent between the active objects
Active Objects • Any objects that play a role in the system • Participate by sending and/or receiving messages • Placed across the top of the diagram • Can be: – An actor (from the use case diagram) – Object/class (from the class diagram) within the system
Active Objects • Can be any object or class that is valid within the system my. Birthdy • Object naming – Syntax : Date [instance. Name][: class. Name] 1. Class name only : Classname 2. Instance name only object. Name 3. Instance name and class name together object: Class
Actor • A person or system that derives benefit from and is external to the system • Participates in a sequence by sending and/or receiving messages
Messages • Used to illustrate communication between different active objects of a sequence diagram • Used when an object needs – to activate a process of a different object – to give information to another object
Exercise 1. (1) Please list active objects, actors, and classes. (2) Please point out messages, life line and focus of control. (3) Where is the condition?
Synchronous Messages • The routine that handles the message is completed before the calling routine resumes execution.
Asynchronous Messages • Calling routine does not wait for the message to be handled before it continues to execute. – As if the call returns immediately • Examples – Notification of somebody or something – Messages that post progress information
Sequence Diagrams • Concurrency obj 3: Class
Exercise 2. Design a sequence diagram of a Web-based survey system • c 1 is an object of class creator • q 1 is an object of class Question. Bank • s 1 is an object of class Survey • c 1 sends the add. Questions() message to q 1 • q 1 returns “Question Added” to c 1 • Then, q 1 sends the post. Survey() message to s 1 • After s 1 handles the post. Survey() message, it returns “View Survey” to c 1
Exercise 2. Sequence Diagram of Webbased Survey message()
Control information: Iteration • may have square brackets containing a continuation condition (until) specifying the condition that must be satisfied in order to exit the iteration and continue with the sequence • may have an asterisk followed by square brackets containing an iteration (while or for) expression specifying the number of iterations syntax: * [ ‘[‘ expression ‘]’ ] message-label
Iteration example
The control mechanisms suffice only for modeling simple alternatives. • Consider drawing several diagrams for modeling complex scenarios. • Don’t use sequence diagrams for detailed modeling of algorithms (this is better done using activity diagrams, pseudo-code or state-charts).
Creating Objects: Notation for creating an object on-the-fly • Send the <<create>> message to the body of the object instance • Once the object is created, it is given a lifeline. – Now you can send and receive messages with this object as you can any other object in the sequence diagram.
Creation and destruction of an object § Creation and destruction are denoted by the stereotypes <<create>> and <<destroy>>
Object Creation An object may create another object via a <<create>> message.
Object Destruction • An object may destroy another object via a <<destroy>> message. – An object may destroy itself. – Avoid modeling object destruction unless memory management is critical.
Exercise 3. Please design a system sequence diagram for PRINT a Report
An earlier design without using a CASE tool Time: 30 Min 38
New design using draw. io Time: 45 Min 15 min to learn draw. io Feel free to use my template posted on Canvas.
Survey: Which topic should we cover in our next lecture? • Topic 1: GDB – debugging tool in Linux • Topic 2: Project 2 - Sequence Diagrams
- Slides: 32