Software Engineering COMP 201

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Advertisements

UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Chapter 15: System Modeling with UML
Systems Analysis and Design in a Changing World, Fourth Edition
Summary Class responsibility cards can be used to help allocate responsibilities between different classes. The use of stereotype classes, such as entity,
Essentials of interaction diagrams Lecture 23 & 24.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
Essentials of state and activity diagram Lecture 24.
© Copyright Eliyahu Brutman Programming Techniques Course.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
7M822 UML Interaction Diagrams 25 November 2010.
Use Case Analysis – continued
SE-565 Software System Requirements More UML Diagrams.
Unified Modeling Language
Object-Oriented Analysis and Design
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
Lecture 6 Unified Modeling Language (UML)
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
程建群 博士(Dr. Jason Cheng) 年03月
Interaction diagrams Sequence and collaboration diagrams.
CS 360 Lecture 6.  A model is a simplification of reality  We build models to better understand the system being developed.  We build models of complex.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
The Object-Oriented Approach to Requirements
Systems Analysis and Design in a Changing World, Fifth Edition
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Interaction Models (2): Sequence Diagrams Extracted from textbook: Object Oriented Modeling and Design with UML M. Blaha, J. Rumbaugh 1.
Behavioral Modeling Chapter 8.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Sequence diagram in UML Martin Palkovik. Sequence diagram  It is a graphic representation of system operations based on chronology - a time sequence.
An Introduction to the Unified Modeling Language
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Design Jon Walker. More UML ● What is UML again?
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Object Oriented Analysis and Design Class and Object Diagrams.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
Dynamic Models Sequence Diagrams Collaboration Diagrams Activity Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
Lecture 14 22/10/15. The Object-Oriented Analysis and Design  Process of progressively developing representation of a system component (or object) through.
Chapter 3: Introducing the UML
CSCI 383 Object-Oriented Programming & Design Lecture 7 Martin van Bommel.
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
1 Kyung Hee University Interaction Diagrams Spring 2001.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Unified Modeling Language. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems,
UML Diagrams By Daniel Damaris Novarianto S..
Object-Oriented Analysis and Design
Unified Modeling Language
UML Diagrams Jung Woo.
Business System Development
Week 12: Activity & Sequence Diagrams
Chapter 20 Object-Oriented Analysis and Design
CIS 375 Bruce R. Maxim UM-Dearborn
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

Software Engineering COMP 201 Lecturer: Sebastian Coope Ashton Building, Room G.18 E-mail: coopes@liverpool.ac.uk COMP 201 web-page: http://www.csc.liv.ac.uk/~coopes/comp201 Essentials of Interaction Diagrams COMP201 - Software Engineering

Outline Use case diagrams Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object to itself Suppressing detailed behaviour Creation and deletion of objects Timing COMP201 - Software Engineering

Use Case Diagrams Use case diagrams show the interaction of users of the system with the functionality of the system. A use case is a functional component of the system that accomplishes a specific task, and is represented by an ellipse. An actor, depicted as a stickman figure, is a user (human or non-human) of the system performing a specific role. Use case diagrams are used early in the development process to refine the functional specifications, identify user interface requirements and to define the scope of the project. COMP201 - Software Engineering

Use Case Diagram Example Remember, a use case diagram show the functionality of the system but not the sequence of events (the sequence of events or alternate courses of action inside a single use case can be shown in its description). Shopping System Place Order Validate Customer Track Order Seller COMP201 - Software Engineering

UML Use Cases Remember that it’s also necessary to describe each use case. To describe a use case, we could use natural language, structured natural language, sequence diagrams, state diagrams etc. If we use an <<extend>> relation, we should also describe which of the use cases will be chosen. The <<include>> and <<extend>> relations are an advanced feature and should be used with care; remember they add to the complexity of the diagram. COMP201 - Software Engineering

Class Diagrams A Class diagram shows the static structure of the system. It defines model elements such as classes, interfaces, and user-defined data types, their internal structure, and their relationships to each other. Relationships, or associations, are shown as lines connecting elements, and are annotated to describe the relationships and their cardinality (1..1, 1..*, 0..*, etc.). Inheritance (generalize/specialize), aggregation (comprises), and composition (has) relationships are also captured in this diagram. COMP201 - Software Engineering

Class Diagrams Class attributes and their data types are identified here, as are the operations and their return types. Visibility is indicated by +, #, or - for public, protected, or private attributes or operations respectively. The class diagram plays a vital role in the transition from design to implementation as it contains sufficient detail to begin the coding process. It is often used to partition responsibilities among the project team members, and to guide and measure the implementation process. COMP201 - Software Engineering

Class Diagram Example COMP201 - Software Engineering

Important UML Models We have now seen the two most important UML models: The use case model, which describes the tasks which the system must help to perform The class model, which describes the classes which are to be implemented and the relationships between them UML’s interaction diagrams allow us to record, in detail, how objects interact to perform a task COMP201 - Software Engineering

Collaborations UML provides two sorts of interaction diagram, sequence diagrams and collaboration diagrams. Collectively, the objects which interact to perform some task, together with the links between them, are known as a collaboration Objects - Each object is shown as rectangle, which is labelled objectName: className Links - Links between objects are shown like associations in the class model. Actors - Actors can be shown as on a use-case diagram COMP201 - Software Engineering

A Simple Collaboration, Showing no Interaction A collaboration, without any interaction shown, is rather like an instance of part of the class model. It shows objects, links and actors COMP201 - Software Engineering

Interaction on Collaboration Diagrams Each labelled arrow represents a message sent from the object at the tail of the arrow to the object at the point of the arrow. Furthermore, the target object must understand the message That is, the class of the object at the point of the arrow must provide the appropriate operation COMP201 - Software Engineering

Sequence Diagrams A sequence diagram shows the objects and actor which take part in a collaboration at the top of dashed lines. Sequence diagrams are applicable to modeling real-time interactive systems or complex scenarios. COMP201 - Software Engineering

Interaction Shown on a Sequence Diagram COMP201 - Software Engineering

The vertical dimension of a sequence diagram represents time The horizontal dimension represents the different objects or roles that participate in the interactive sequence. An object’s lifeline is shown as a narrow vertical bar. COMP201 - Software Engineering

Time is assumed to pass as we move from the top to the bottom of the diagram. Messages between objects are shown as solid line arrows, and their returns are shown as dashed line arrows. COMP201 - Software Engineering

Homework 1) List all the pairs of classes that can communicate directly with each other. 2) For each class, list all the methods that need to be included, based on this sequence diagram resource manager Res. Mgr. Win: UI :Worker :Skill :SkillLevel find worker find worker by name find skill find skill by name assign skill to worker [worker does not currently have skill] assign skill to worker COMP201 - Software Engineering

Messages from an Object to Itself An object may, and frequently does, send a message to itself (i.e. An object calls another method on itself; Java uses keyword “this”). On a collaboration diagram you show a link from the object to itself, and messages pass along that link in the usual way On a sequence diagram, you show a message arrow from the object’s lifeline back to itself. COMP201 - Software Engineering

Messages from an Object to Itself In pure object oriented programming, every function invocation is the result of a message, and objects may send messages to themselves so often that an interaction diagram becomes cluttered You might choose to omit messages from an object to itself, counting such things as internal computation within the object. This is a type of abstraction. COMP201 - Software Engineering

Suppressing Detailed Behaviour It is often sensible to describe interaction at a higher level, rather than showing every message between every pair of objects. To do this we define a (full) sub-collaboration of a collaboration Collaboration is a collection of objects and links between them Sub-collaboration is a subset of the objects, together with the links connecting those objects. COMP201 - Software Engineering

Using a Package to Simplify a Collaboration COMP201 - Software Engineering

Creation and Deletion of Objects The set of objects involved in an interaction is not always static; objects may be created and deleted during an interaction. Collaboration diagram These show which objects are created and destroyed during an interaction by adding the constraints {new} {destroyed}. If the object is both created and destroyed in the same interaction, it can be labelled {transit} Sequence diagram These show an object being created by putting its object box part-way down the page, at the point it is created Destruction of an object is shown by its activation ending with a large X. COMP201 - Software Engineering

Example Collaboration Diagram COMP201 - Software Engineering

Example Sequence Diagram This object is only created at this point.. The Lecturer object is destroyed here.. COMP201 - Software Engineering

Timing The major advantage of sequence diagrams over collaboration diagrams is their ability to represent the passage of time graphically. So far we have let the diagram indicate only the relative ordering of messages. Sometimes, however, the actual times are important. A system in which actual times are important is called a real-time system. COMP201 - Software Engineering

Timing Constraints on a Sequence Diagram COMP201 - Software Engineering

Activity Diagrams Activity diagrams describe how activities are coordinated. For example, an activity diagram may be used (like an interaction diagram) to show how an operation could be implemented An activity diagram is particularly useful when you know that an operation has to achieve a number of different things, and you want to model what the essential dependencies between them are, before you decide in what order to do them Activity diagrams are much better at showing this clearly than interaction diagrams. COMP201 - Software Engineering

Activity Diagrams We may identify different use-cases for example but some must be completed before others can begin. Recording the order in which we must complete these use-cases can be aided by using an activity diagram Activity diagrams record the dependencies between activities, such as which things can happen in parallel and which must occur sequentially. COMP201 - Software Engineering

Activity Diagrams At the UML semantics level, activity diagrams are state diagrams extended for convenience with some extra notation Elements of activity diagrams Activity Transition Synchronization bar Decision diamond Start and stop markers COMP201 - Software Engineering

Activity Diagrams Activity – An activity is recorded like the notation for a state. However, we do not have transitions as a result of event, rather as the finishing of an activity. Activity edge – an arrow to indicate where to move in the diagram after an activity finishes. These can be labelled with a guard condition. Synchronisation bar – a thick horizontal bar describing the co-ordination of activities which must all be completed before the activity edges leading from the bar are fired. COMP201 - Software Engineering

Activity Diagrams Decision Diamond – can be used to show decisions as an alternative to guards on separate states leaving the same activity. Stop/Start markers – are used in the same way as in a state diagram (initial/final states). Let’s see an example of an activity diagram for a library system (note that we partition the diagram to activities involving a library member and those also involving the librarian).. COMP201 - Software Engineering

Business Level Activity Diagram of a Library COMP201 - Software Engineering

Activity Diagrams and State Diagrams: We can see several differences between activity diagrams and state diagrams: Activity diagrams do not normally include events Activity is intended to proceed, following the flow described by diagram, without getting stuck. Thus usually one of the guards of an edge leaving an activity should be satisfied Concurrent activities can be modelled by using the synchronisation bar notation. COMP201 - Software Engineering

Lecture Key Points We have seen Collaboration Diagrams and Interactions on them. We have also studied sequence diagrams to represent the passage of time graphically and timing constraints that may be imposed upon them. COMP201 - Software Engineering