Lecture 10 ISM - © 2010 Houman Younessi Convener: Houman Younessi 1-860-548-7880 Information Systems Spring 2011.

Slides:



Advertisements
Similar presentations
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
Advertisements

UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
UML Class Diagram and Packages
MGMT ASAD HO 8 © HY 2006 Lecture 8 A dvanced S ystems A nalysis and D esign Fall 2006 Convener: Houman Younessi
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
Class Diagram & Object Diagram
- 1 - © Houman Younessi 2010 MGMT Advanced Systems Analysis and Design A dvanced S ystems A nalysis and D esign Fall 2010 Convener: Houman Younessi.
- 1 - © Houman Younessi 2010 MGMT Advanced Systems Analysis and Design A dvanced S ystems A nalysis and D esign Fall 2010 Convener: Houman Younessi.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
SE-565 Software System Requirements More UML Diagrams.
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Unified Modeling Language
Unified Modeling Language
Object-Oriented Analysis and Design
UML for Java Programmers Object Mentor, Inc. Copyright  by Object Mentor, Inc All Rights Reserved
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Class Diagram.
ECSE Software Engineering HO 4 © HY 2012 Lecture 4 System Modeling In SE, we have an array of notations and diagrams for modeling in each.
- 1 - © Houman Younessi 2006 MGMT Advanced Systems Analysis and Design A system is identified in terms of the single goal it is to achieve. A system.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 21. Review ANALYSIS PHASE (OBJECT ORIENTED DESIGN) Functional Modeling – Use case Diagram Description.
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.
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.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Lab 04.
Distributed Java Programming Distributed Java Programming Class #2 August 22, 2002.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Unit 1 INTRODUCTION TO MODELING AND CLASS MODEL Ref : L7-UML.PDF.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis and Design Class and Object Diagrams.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
Scenario A scenario is a sequence of steps describing an interaction between a user and a system. Use case is a set of scenarios tied together by a common.
Chapter 3 Class Diagrams. 2 Outline Class Basics Class Basics Classes Classes Association Association Multiplicity Multiplicity Inheritance Inheritance.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
UML Part 1: Class Diagrams. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and notations presented.
Chapter 16 UML Class Diagrams.
Chapter 3: Introducing the UML
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
Activity & Class Modeling Labs Discussion p3 T120B pavasario sem.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
 Class and Diagram  Representation of Class Name Attributes Operations  Visibility of Attributes and Operations.
Object-Orientated Analysis, Design and Programming
UML-Class Diagrams. UML-Class Diagrams Order placement problem A Company has two types of customers, corporate customers and personal customers. All.
Chapter 16 UML Class Diagrams.
Chapter 11: Collaboration Diagram - PART1
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Introduction to UML Introduction to UML Shiyuan Jin September,23,2002
Object Oriented Analysis and Design
Requirements To Design In This Iteration
UML Class Diagram.
Analysis models and design models
Business Analysis More on Classes Chris Russell O2.41
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Object Oriented System Design Class Diagrams
Presentation transcript:

Lecture 10 ISM - © 2010 Houman Younessi Convener: Houman Younessi Information Systems Spring 2011

Lecture 10 ISM - © 2010 Houman Younessi Structural Modeling: Answers the question WHAT? We need to concentrate on static relationships between objects (SNAPSHOT). So, we need to depict: ObjectsClasses Links Associations Class Diagram

Lecture 10 ISM - © 2010 Houman Younessi CLASSES The implementation of a type A generator for instances A class is depicted as a solid-outlined rectangle with compartments: Must have a name compartment May have other compartments (up to 3 more)

Lecture 10 ISM - © 2010 Houman Younessi The other compartments may contain: Compartment 2: Attributes Compartment 3: Operations Compartment 4: Others (Business rules, exceptions, etc.) Name Compartment Attributes Compartment Operations Compartment Other Compartment Widget color: Color position:Coord=(0,0) move(from:Coord,to:Coord=(50,50)) get_color( ):Color draw( ) draw_all( ) color /= “white”

Lecture 10 ISM - © 2010 Houman Younessi Class name and the class name compartment: The name compartment must be present The name compartment contains the name of the class. Class names are centered, begin with a capital letter and are in boldface. Abstract class names are italicized.

Lecture 10 ISM - © 2010 Houman Younessi Attributes and the attribute compartment: May be omitted when drawing high level diagrams Are denoted as left justified plain lowercase text strings The name may be followed by a colon ( : ) followed by the type of the attribute Optionally we can set the initial value of the attribute. To do so, the type name is followed by ( = ) and then the value

Lecture 10 ISM - © 2010 Houman Younessi May contain a visibility tag. A visibility tag could be: +Public # Protected -Private

Lecture 10 ISM - © 2010 Houman Younessi Operations and the operations compartment: May be omitted when drawing high level diagrams Are denoted as left justified plain lowercase text strings. Abstract operations are italicized May have parentheses containing a comma separated list of the parameters of the method that implements the operation. Optionally the parameter list may have indicators. These are:

Lecture 10 ISM - © 2010 Houman Younessi inParameter is only passed in to the operation outParameter is only passed out (returned) inoutBoth (Default is “in”) May have a return list containing one or a comma separated list of more than one formal parameters following a colon after the parameter list. Multiple return parameters, if there, must have a name and a type separated by a colon.

Lecture 10 ISM - © 2010 Houman Younessi An operation may have a class scope. Class operations are underlined. May contain a visibility tag. A visibility tag could be: +Public # Protected -Private

Lecture 10 ISM - © 2010 Houman Younessi Attribute - color:Color=red Operation: # credit_rating(in candidate:Customer=current, in agency: Agent=dandb) : rating : Integer, reason : Text Usually we do not bother with this level of detail unless we aim to generate code automatically

Lecture 10 ISM - © 2010 Houman Younessi RELATIONSHIPS There are three basic types of relationship between classes. These are: Inheritance Aggregation Association

Lecture 10 ISM - © 2010 Houman Younessi INHERITANCE Parent Child 2Child 1 Discriminator …...

Lecture 10 ISM - © 2010 Houman Younessi Person FemaleMale gender Example:

Lecture 10 ISM - © 2010 Houman Younessi AGGREGATION Two types in UML: Weak aggregation Composition Brain Person Department Professor Composition Weak aggregation

Lecture 10 ISM - © 2010 Houman Younessi ASSOCIATIONS Association shows a named relationship between instances of a class and other instances of itself or between instances of two or more other classes. Class A Class B Role A:Class Role B:Class Name of Association Multiplicity

Lecture 10 ISM - © 2010 Houman Younessi Each association has two roles, each role is a direction on the association. These roles can be explicitly named on the association with a label. If not explicitly labeled, then the role name is the same as the target class and may be omitted. Order Person customer Is placed by

Lecture 10 ISM - © 2010 Houman Younessi ABABABAB 1 1..* 0..1 * An A is always associated with exactly one B An A is always associated with one or more B An A is always associated with zero or one B An A is always associated with zero or more B AB n An A is always associated with exactly n B n..m An A is always associated with n to m B Where n is any integer number greater than 1 Where n,m are integer numbers and m>n AB

Lecture 10 ISM - © 2010 Houman Younessi An association may have direction. When it does, the direction is shown with an arrow. AB In the above diagram, A, is called the source and B is the target. A bi-directional arrow indicates navigability in both directions. AB

Lecture 10 ISM - © 2010 Houman Younessi An association with a “many” side may be ordered. Ordering is shown as a label on the target class. Screen Window * {ordered} Visible on

Lecture 10 ISM - © 2010 Houman Younessi An association may be higher than binary. A Ternary Association Name Class A Class B Class C

Lecture 10 ISM - © 2010 Houman Younessi reservation Person Flight Seat Example:

Lecture 10 ISM - © 2010 Houman Younessi Employee sales rep 0..1* Corporate Customer Personal Customer Product contactName creditRating remind() bill(Real) creditCard# Customer name address rating():Integer 1 {if Order.customer.rating = 5 then Order.isPrepaid := True} * line item Order 1 * dateReceived: Date isPrepaid:Boolean number:String price:Money dispatch() close(Real) quantity:Integer price:Money isFilled: Boolean creditRating() >=4 Order Line

Lecture 10 ISM - © 2010 Houman Younessi Event State A relevant punctuation in time The arrival of a message A stimulus received by an object A relevant interval in time Response of an object to a message or event A response to a stimulus Events take no time States are held in time

Lecture 10 ISM - © 2010 Houman Younessi coin is inserted(amount) flight leaves(airline,number) mouse_button_clicked(button, location) item_select_mode cruising edit_mode Event State Events carry information from an object to another (a message), objects receive that information and may change state

Lecture 10 ISM - © 2010 Houman Younessi Event State Events can be thought of as a feature call on the target object. States can be thought of as an abstraction of the attribute values of the target object between two relevant events.

Lecture 10 ISM - © 2010 Houman Younessi SEQUENCE DIAGRAMS A sequence diagram captures the order of events and the direction of the messages passed. There are two forms of sequence diagrams: Simple sequence diagrams (Event Traces) Full sequence diagrams with concurrency

Lecture 10 ISM - © 2010 Houman Younessi caller:Person callee:Person Modem1:Modem modem2:Modema_line:Connection wake connect sound_dial_tone acknowledge accept_dial_ sequence ringing_tone disconnect dial_tone dial sound_ring_tone connect stop_ring_tone disconnect_signal break_connect stop_ring connect picked_ up ring_phone routed receive_call_ signal dial_tone phone_ringing connected sound_dial_tone

Lecture 10 ISM - © 2010 Houman Younessi modem1:Modem a_Line:Connection connect() sound_dial_tone() *[n]dial(n:Digit) modem2:Modem sound_ring_tone() ring_tone() picked_up() connect() [while caller not hang_up()] disconnect signal() break_connection() [while caller not hang_up()] *[n]dial(n:Digit)5 Asynch. Event Synch. Event Activation Continuation Condition Iteration Condition Object life termination routed() receive_call_signal() stop_ ringing_tone() stop_ ringing() break_connection() sound_dial_tone()

Lecture 10 ISM - © 2010 Houman Younessi modem1:Modem a_Line:Connection connect() sound_dial_tone() *[n]dial(n:Digit) modem2:Modem sound_ring_tone() ring_tone() picked_up() connect() [while caller not hang_up()] disconnect signal() break_connection() routed() receive_call_signal() stop_ ringing_tone() stop_ ringing() break_connection() sound_dial_tone() caller:Person callee:Person wake acknowledge ringing_tone connected disconnect dial_tone phone_ringing connected dial_tone dial

Lecture 10 ISM - © 2010 Houman Younessi modem1:Modem a_Line:Connection connect() sound_dial_tone() *[n]dial(n:Digit) modem2:Modem sound_ring_tone() ring_tone() picked_up() connect() [while caller not hang_up()] disconnect signal() break_connection() routed() receive_call_signal() stop_ ringing_tone() stop_ ringing() break_connection() sound_dial_tone() wake acknowledge ringing_tone connected disconnect dial_tone Phone_ringing connected dial_tone caller callee dial

Lecture 10 ISM - © 2010 Houman Younessi COLLABORATION DIAGRAMS Collaboration diagrams also show the message exchange (collaboration) between several objects. They do so by depicting the message exchange between object icons through numbering the messages traveling between these objects.

Lecture 10 ISM - © 2010 Houman Younessi Modem:modem_2 Connection:aLine 1- connect() 3- *[n] dial(n:Digit) 10- disconnect_signal() 2- sound_dial_tone () 6a- ringing_tone() 8a- stops_ring_tone() 9a-connect( ) 11a- break_connection() 12a- sound_dial_tone 4- receive_call_signal() 6b- sound_ring_tone() 8b- stop_ringing() 9b- connect() 11b-break_connection() 12b- sound_dial_tone() 5- routed() 7-picked_up() Modem:modem_1 EXAMPLE COLLABORATION DIAGRAM

Lecture 10 ISM - © 2010 Houman Younessi STATE DIAGRAMS A state diagram relates events and states. State diagrams may be drawn from the perspective of the whole system as a single object, or from the perspective of any single object at any level of granularity. State diagrams may show concurrency or may be nested Usually it is best to draw the state diagram of only one object in the system at a time

Lecture 10 ISM - © 2010 Houman Younessi idle dial tone do/sound_dial_tone() connecting do/receive_call_signal () ringing do/sound_ring_tone ()do/ring_phone() connecte d disconnect_signal( ) picked_up() dial() routed() connect() disconnected reset() State Diagram of a modem communication line, normal case, successful connection. connected do/stop_ring_tone() do/stop_ring() do/connect() do/break_connection() do/sound_dial_tone()

Lecture 10 ISM - © 2010 Houman Younessi idle dial tone do/sound_dial_tone() connecting do/receive_call_signal() ringing do/sound_ring_tone ()do/ring_phone() connecte d disconnect_signal() picked_up() dial() routed() connect() disconnected reset() connected do/stop_ring_tone() do/stop_ring() do/connect() do/break_connection() do/sound_dial_tone() time-out do/ beep() time_out() busy tone do/ slow_tone() busy_num() fast busy tone do/fast_tone() busy_trunk() message do/play() message-done() invalid_num() reset() State Diagram of a modem communication line, with normal, and a number of non-normal cases.

Lecture 10 ISM - © 2010 Houman Younessi ringing do/sound_ring_tone ( ) idle connect do/connect ( ) acknowledge do/acknowledge ( ) dial do/dial( ) data ex. disconnecting do/disconnect_signal() wake() sound_dial_ tone() dial() stop ringing() connect( ) disconnect() break_connection() sound_ringing_tone() sound_dial_tone()

Lecture 10 ISM - © 2010 Houman Younessi Transformations This is the third modeling view. It answers the question “how”. Depending on level of granularity there are many techniques. Including: High Level: Activity Diagrams Low Level: Pseudocode Flowcharts etc. Not part of UML

Lecture 10 ISM - © 2010 Houman Younessi Activity diagrams depict the processing aspects of the system. They are similar to flowcharts except: ACTIVITY DIAGRAMS Activity charts allow synchronization They are similar to dataflow diagrams except: Communication between activities is via messages carrying data not the data itself Activity charts allow synchronization

Lecture 10 ISM - © 2010 Houman Younessi Order Processing Finance Stock Manager Receive Order Receive Supply Select Outstanding order item Assign Goods to Order Assign Item to Order Reorder Item Add Remainder to Stock Check Line Item Cancel Order Check order Authorize payment [failed] [succeeded] Dispatch Order [Stock assigned to all line items and payment authorized] *[for each line item on order] * [for each chosen order item] [in stock] [all outstanding order items filled] [notify supply] [out of stock]