Lecture 13. Unified Modeling Language (UML) The first applications you wrote in CS201 were easy to think out and code with no intermediate steps. Lab.

Slides:



Advertisements
Similar presentations
UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
Advertisements

UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
Introduction to UML. Acknowledgements Slides material are taken from different sources including: Slides material are taken from different sources including:
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Department of Computing
Software Engineering COMP 201
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Chapter 15: System Modeling with UML
Slide 10A.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Essentials of interaction diagrams Lecture 23 & 24.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
The Unified Modeling Language
© Copyright Eliyahu Brutman Programming Techniques Course.
Unified Modeling Language
Introduction to UML Prashanth Aedunuthula Fall, 2004.
Introduction to UML Shiyuan Jin Fall, 2006.
Slide 16A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering.
CS3773 Software Engineering
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.
Prepared by Afra`a Sayah. Introduction. Weekly Tasks. Plane Phase. Analysis Phase. Design Phase. Report Rules. Conclusion. 2.
System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD.
Lecture 7 Object Oriented Design. Outline  What is UML and why we use UML?  How to use UML diagrams to design software system?  What UML Modeling tools.
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.
COP4331UML Lecture Presented By: Antoniya Petkova 9/11/2009 Originally Prepared By: Pengju Shang for EEL5881 Software Engineering I.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Lab 04.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
EEL5881 Software Engineering I UML Lecture Yi Luo.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Class diagram Used for describing structure and behaviour in the use cases Provide a conceptual model of the system in terms of entities and their relationships.
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.
Drawing System Sequence Diagrams
Use Case Diagram The purpose is to communicate the system’s functionality and behaviour to the customer or end user. Mainly used for capturing user requirements.
Design Jon Walker. More UML ● What is UML again?
SWT - Diagrammatics Lecture 4/4 - Diagramming in OO Software Development - partB 4-May-2000.
Design Model Lecture p6 T120B pavasario sem.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
(14-2) UML Instructor - Andrew O’Fallon CptS 122 (December 2, 2015) Washington State University.
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,
UML (Unified Modeling Language)
Chapter 3: Introducing the UML
UML Course Instructor: Rizwana Noor. Overview  Modeling  What is UML?  Why UML?  UML Diagrams  Use Case  Components  Relationships  Notations.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
Introduction to UML Created By: Ajay Bahoriya. Acknowledgements Slides material are taken from different sources including: Slides material are taken.
SWE 214 (071) Introduction to UML Slide 1 Introduction to UML.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
System modeling and the Unified Modeling Language (UML) CS
UML CSE 470 : Software Engineering. Unified Modeling Language UML is a modeling language to express and design documents, software –Particularly useful.
UML CSE 470 : Software Engineering. Unified Modeling Language UML is a modeling language to express and design documents, software –Particularly useful.
Introduction to UML Mohammad Zubair Ahmad Summer 2007.
 Class and Diagram  Representation of Class Name Attributes Operations  Visibility of Attributes and Operations.
Lecture 14 CS202.
UML-Class Diagrams. UML-Class Diagrams Order placement problem A Company has two types of customers, corporate customers and personal customers. All.
Introduction to UML Majid Ali Khan Spring 2005 Introduce myself.
Inheritance Allows extension and reuse of existing code
Object-Oriented Analysis and Design
Introduction to UML Shiyuan Jin Spring, 2006.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Introduction to UML Introduction to UML Shiyuan Jin September,23,2002
Sequence Diagrams.
Software models and the Unified Modeling Language (UML)
Simple UML 13 Nov 2018.
Shiyuan Jin Fall, 2003 September,16,2003
CSE470 Software Engineering UML Lecture.  UML resource page
Chapter 11: Class Diagram
Presentation transcript:

Lecture 13

Unified Modeling Language (UML) The first applications you wrote in CS201 were easy to think out and code with no intermediate steps. Lab 6 involved some communication with your lab partner and the use of an interface to define how the parts of the application fit together. As your applications get larger and involve more people, they will require better planning tools. These often involve documents which specify requirements and describe how the parts of the application fit together.

Unified Modeling Language (UML) The following slides are slightly revised versions of slides by Yi Luo, Carnegie-Mellon University: ll07/UML_Lecture.ppt

UML Diagrams Types of UML Diagrams:  Use Case Diagram  Class Diagram  Sequence Diagram  Collaboration Diagram  State Diagram This is only a subset of diagrams chosen from among the most widely- used types Source of slides: Yi Luo, Carnegie-Mellon University

Use-Case Diagrams A use-case diagram shows a set of use cases A use case is a model of the interaction between  External users of a software product (actors) and  The software product itself  More precisely, an actor is a user playing a specific role describing a set of user scenarios capturing user requirements contract between end user and software developers Source of slide: Yi Luo, Carnegie-Mellon University

Use-Case Diagrams Library System Borrow Order Title Fine Remittance Client Employee Supervisor Boundary Actor Use Case

Use-Case Diagrams Actors: A role that a user plays with respect to the system, including human users and other systems. e.g., inanimate physical objects (e.g. robot); an external system that needs some information from the current system. Use case: A set of scenarios that describing an interaction between a user and a system, including alternatives. System boundary: rectangle diagram representing the boundary between the actors and the system.

Use-Case Diagrams Association: communication between an actor and a use case; Represented by a solid line. Generalization: relationship between one general use case and a special use case (used for defining special alternatives) Represented by a line with a triangular arrow head toward the parent use case.

Use-Case Diagrams Extend: a dotted line labeled > with an arrow toward the base case. The extending use case may add behavior to the base use case. The base class declares “extension points”. > Include: a dotted line labeled > beginning at base use case and ending with an arrows pointing to the include use case. The include relationship occurs when a chunk of behavior is similar across more than one use case. Use “include” in stead of copying the description of that behavior. >

Use-Case Diagrams Figure The McGraw-Hill Companies, 2005

Use-Case Diagrams Both Make Appointment and Request Medication include Check Patient Record as a subtask (include) The extension point is written inside the base case Pay bill; the extending class Defer payment adds the behavior of this extension point. (extend) Pay Bill is a parent use case and Bill Insurance is the child use case. (generalization) (TogetherSoft, Inc)

Class diagram A class diagram depicts classes and their interrelationships Used for describing structure and behavior in the use cases Provide a conceptual model of the system in terms of entities and their relationships Detailed class diagrams are used for developers

Class diagram Each class is represented by a rectangle subdivided into three compartments  Name  Attributes  Operations Modifiers are used to indicate visibility of attributes and operations.  ‘+’ is used to denote Public visibility  ‘#’ is used to denote Protected visibility  ‘-’ is used to denote Private visibility By default, attributes are hidden and operations are visible.

Class diagram Account - Customer_Name - Balance +deposit( ) +withdraw( ) Name Attributes Operations

OO Relationships There are two kinds of Relationships  Generalization (parent-child relationship)  Association (student enrolls in course) Associations can be further classified as  Aggregation  Composition

Subtype2 Supertype Subtype1 OO Relationships: Generalization -Inheritance is a required feature of OOP -Generalization expresses a parent/child relationship among related classes. -Used for abstracting details in several layers Regular Customer Loyalty Customer Example:

Represent relationship between instances of classes  Student enrolls in a course  Courses have students  Courses have exams  Etc. Association has two ends  Role names (e.g. enrolls)  Multiplicity (e.g. One course can have many students)  Navigability (unidirectional, bidirectional) OO Relationships: Association

Association: Multiplicity and Roles UniversityPerson * * Multiplicity SymbolMeaning 1One and only one 0..1Zero or one M..NFrom M to N (natural language) *From zero to any positive integer 0..*From zero to any positive integer 1..*From one to any positive integer teacher employer Role “A given university groups many people; some act as students, others as teachers. A given student belongs to a single university; a given teacher may or may not be working for the university at a particular time.” student

Class diagram [from UML Distilled Third Edition]

OO Relationships: Composition Class W Class P 1 Class P 2 Association Models the part–whole relationship Composition Also models the part–whole relationship but, in addition, every part may belong to only one whole, and If the whole is deleted, so are the parts Example: A number of different chess boards: Each square belongs to only one board. If a chess board is thrown away, all 64 squares on that board go as well. Whole Class Part Classes Example Figure 16.7 The McGraw-Hill Companies, 2005 [From Dr.David A. Workman]

OO Relationships: Aggregation Class C Class E 1 Class E 2 AGGREGATION Container Class Containee Classes Bag Apples Milk Example Aggregation: expresses a relationship among instances of related classes. It is a specific kind of Container- Containee relationship. express a more informal relationship than composition expresses. Aggregation is appropriate when Container and Containees have no special access privileges to each other. [From Dr.David A. Workman]

Aggregation vs. Composition Composition Composition is really a strong form of association  components have only one owner  components cannot exist independent of their owner  components live or die with their owner  e.g. Each car has an engine that can not be shared with other cars. Aggregations may form "part of" the association, but may not be essential to it. They may also exist independent of the aggregate. e.g. Apples may exist independent of the bag.

Interaction Diagrams show how objects interact with one another UML supports two types of interaction diagrams  Sequence diagrams  Collaboration diagrams

Sequence Diagram(make a phone call) CallerPhoneRecipient Picks up Dial tone Dial Ring notificationRing Picks up Hello

Sequence Diagram:Object interaction Self-Call Self-Call: A message that an Object sends to itself. Condition: indicates when a message is sent. The message is sent only if the condition is true. Iteration Condition AB Synchronous Asynchronous Transmission delayed Self-Call [condition] remove() *[for each] remove()

Sequence Diagrams – Object Life Spans Creation  Create message  Object life starts at that point Activation  Symbolized by rectangular stripes  Place on the lifeline where object is activated.  Rectangle also denotes when object is deactivated. Deletion  Placing an ‘X’ on lifeline  Object’s life ends at that point Activation bar A B Create X Deletion Return Lifeline

Sequence Diagram Sequence diagrams demonstrate the behavior of objects in a use case by describing the objects and the messages they pass. The horizontal dimension shows the objects participating in the interaction. The vertical arrangement of messages indicates their order. The labels may contain the seq. # to indicate concurrency. Message

Interaction Diagrams: Collaboration diagrams User Catalog Reservations start 1: look up 2: title data 3 : [not available] reserve title 4 : title returned 5 : hold title 6 : borrow title 6: remove reservation 5: title available  Collaboration diagrams are equivalent to sequence diagrams. All the features of sequence diagrams are equally applicable to collaboration diagrams  Use a sequence diagram when the transfer of information is the focus of attention  Use a collaboration diagram when concentrating on the classes

State Diagrams (Billing Example) State Diagrams show the sequences of states an object goes through during its life cycle in response to stimuli, together with its responses and actions; an abstraction of all possible behaviors. Unpaid Start End Paid Invoice createdpayingInvoice destroying

State Diagrams (Traffic light example) Yellow Red Green Traffic Light State Transition Event Start

Installing Eclipse Add Ons There are thousands of add-ons available to add functionality to Eclipse, many of them open source or otherwise free. –Some look free but are actually evaluation versions Choose Help/Eclipse Marketplace, then enter text in the search box Many add ons can be installed with a few clicks

Eclipse Add Ons

Ways To Generate UML Diagrams Microsoft Visio UMLet – Free UML tool Several Eclipse plug ins support UML diagrams. In Eclipse, go to Help / Eclipse Marketplace and enter "UML" in the find box. Some tools are evaluation versions of commercial software, while others are open-source. –Model Goon provides an easy way to generate class diagrams –Many others available