SlideShare ist ein Scribd-Unternehmen logo
1 von 69
Module 3: Advanced Features – Part II: Behavioral Diagrams
3 basic building blocks of UML   -  Diagrams Graphical representation of a set of elements. Represented by a connected graph: Vertices are things; Arcs are relationships/behaviors. 5 most common views built from  UML 1.x: 9 diagram types . UML 2.0: 12 diagram types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Use Case Diagrams ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Use Cases ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],What did we do?
Organizing Use Cases ,[object Object],Track order generalization Validate user Retinal scan Check password Place rush order Place order Extension points: set priority extension inclusion extension   point << extend >> (set priority) << include >> << include >> ,[object Object],[object Object],common to multiple use cases ; Often no  actor may be associated with a ‘used’ use case UML 1.3: Replaces <<uses>> relationship with Generalization and <<include>> dependency (http://www.jeckle.de/files/viewfront.pdf) ,[object Object],extension use case inclusion use case child use case base use case
A  Use Case Template  (http://www.bredemeyer.com/pdf_files/use_case.pdf) ,[object Object],[object Object],Difference for the specific subflow Alt. flow of events /subflows What should hold after the use case successfully completes. Postconditions Subflows may be divided into 1) normal, 2) successful alternate actions, and 3) exception/error flows. Exception flows The happy/sunny day flow. The most common successful case. Basic flow of events What should be true before the use case can start. Preconditions Goal : E.g., “This use case lets a bank account owner withdraw money from an ATM machine”;  Source : Bank doc 2.3 Brief description List of actors involved in use case Actors Identifier: e.g., “Withdraw money”; ref # = wm3; mod history = … Use Case
A Use Case Template (http://www.bredemeyer.com/pdf_files/use_case.pdf) What are the modes of communication between field maintenance engineer and operator Issues (that remain to be resolved) Performance Mean: time to repair network fault must be less than 3 hours Non-Functional (optional) #1. System may detect fault and notify operator or Field maintenance engineer may report fault to Operator Variations (optional) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Steps Changes to network are always successful when applied to a network Assumptions (successful use case termination condition) Operator (primary, Cellular network, Field maintenance engineer) Actors Operator rectifies a report by changing parameters of a cell Description (goal, source) 2. Reparing_Cellular_Network History created 1/5/98 Derek Coleman, modified 5/5/98 Use Case (id, ref#, mod history) How are failures detected? Are roll backs automatic or is Operator intervention required? Issues # 3.3 .  if the changes to network fail then the network is rolled back to its previous state Steps Deals with assumption that network changes can never fail Description Repair_may_fail extends 2. Reparing_Cellular_Network Use Case Extension
Sequence Diagrams ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Interaction Diagrams (sd and cd) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Interaction Diagram:  sequence  vs  communication s1 : StockQuoteSubscriber p : StockQuotePublisher attach(s1) s2 : StockQuoteSubscriber attach(s2) notify() update() update() getState() getState() s1 : StockQuoteSubscriber p : StockQuotePublisher s2 : StockQuoteSubscriber 1 : attach(s1) 6 : getState() 2 : attach(s2) 7 : getState() 3 : notify() 4 : update() 5 : update() Observer design pattern object role:ClassName Procedure call, RMI, JDBC, … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],objects Time {update < 1 minutes} classifiers or their instances, use cases or actors.
Interactions - Modeling Actions ,[object Object],[object Object],[object Object],[object Object],: TicketAgent c : Client p : PlanningAgent <<create>> setItenerary( i ) calculateRoute() route X notify() return value send call on self <<destroy>> actual parameter return end of object life destroy: e.g., in C++ manual garbage collection; in Java/C#, unnecessary ,[object Object],[object Object],[object Object],[object Object],1 natural death/ self destruction asynchronous in 2.0 (stick arrowhead) – no return value expected at end of callee activation half arrow in 1.x activation of caller may end before callee’s  (???) for each conference loop
[object Object],[object Object],[object Object],linking sequence diagrams ob1:C1 ob3:C3 ob2:C2 ob3:C3 op1 [x>0] foo(x) [x<0] bar(x) do(w) do(z) recurse() [z=0] jar(z) ob3:C3 [z=0] jar(z) ob3:C3 conditional recursion Sequence Diagrams  – Generic vs. Instance ,[object Object],[object Object],[object Object],Here, conditional or concurrency?
Timing constraints ,[object Object],[object Object],[object Object],any example?
Interactions  - Procedural Sequencing vs. Flat Sequencing ,[object Object],[object Object],[object Object],[object Object],c : Client x x.k c : Client x y 7 4 5 6 1 2 3 CAN’T TELL RELATIONSHIPS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],8 9 3.1.1 1.1 1.2 3.1 1 2 3 1.1.1 1.1.2
Interactions  – conditional paths, asynchronous message [Craig Larman] [http://www.phptr.com/articles/article.asp?p=360441&seqNum=6&rl=1] :E unconditional :A :C :B :D 1: msg1 1a [test1]:msg2 2: msg7 1b [not test1]:msg3 1c: msg4 a.1:<<create>> 1a and 1b are mutually exclusive conditional paths 1c.1: msg5 active object asynchrous message a.2:update( p ) :F Is this ok? Can you produce a corresponding sd? Is there a unique sequence of paths?
Use Case Modeling Different Levels of Abstraction Interaction Diagram at a High Level of Abstraction : Order Clerk : Order Taker : Order Fulfillment submitOrder placeOrder acknowledgeOrder Interaction Diagram at a Lower Level of Abstraction : Order Clerk : Order Taker : Order Fulfillment : Billing Agent : CreditCard Agen submitOrder placeOrder processCard acknowledgeOrder triggerBill Order Clerk Place Order ,[object Object],[object Object],[object Object],[object Object],<<trace>> <<trace>> model
public Class Selection   {  private Purchase myPurchase = new Purchase();   private Payment myPayment;     public void purchase()   {  myPurchase.buyMajor();   myPurchase.buyMinor():   myPayment = new Payment( cashTender );     //. .    }     // . .    }   :Selection :Purchase :Payment purchase buyMajor buyMinor create(cashTender) Sequence Diagrams & Some Programming
[object Object],[object Object]
sd Withdrawal :User :ATM :Bank ref Authenticate alt alt PIN OK PIN NOK withdraw msg (“amount”) amount (a) chkAcct (a) msg (“card”) msg (“illegal entry”) enough bal not enough bal money receipt msg(“amount too big”) sd Authenticate :User :ATM :Bank ref EnterPIN loop(0,3) PIN NOK msg (“try again”) cardId(cid) Idle ref EnterPIN sd EnterPIN :User :ATM :Bank PIN NOK pin-nok Digit[4] alt pin-ok PIN NOK Code(cid,pin) Frames: References continuation nested fragment operands operator
sd Withdrawal :User :ATM :Bank ref Authenticate PIN OK PIN NOK withdraw msg (“amount”) amount (a) chkAcct (a) msg (“card”) msg (“illegal entry”) not enough bal msg(“amount too big”) Interaction Overview Diagram :User :ATM :Bank sd :User :ATM sd :User :ATM sd enough bal money receipt :User :ATM :Bank sd sd Relationship with Sequence Diagram?
Frames & Interaction Fragment Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Frame : as the graphical boundary, and a labeling mechanism Frame name :  “frame type name[(param type: param name)] [: return type: return name]”  [guard condition] can appear  as the first item underneath
What can be in the top boxes? (http://www.agilemodeling.com/artifacts/sequenceDiagram.htm) Outputting transcripts   Boundary/interface  elements :  software elements such as screens, reports, HTML pages, or system interfaces that actors interact with.   Control/process  elements ( controllers ) :  These serve as the glue between boundary elements and entity elements, implementing the logic required to manage the various elements and their interactions.  Often implemented using objects, but simple ones using methods of an entity or boundary class.   Entity  elements
Modeling Protocols   - Associating Protocols with Ports «interface» Callee «interface» Caller «interface» Operator ClassX ,[object Object],caller operator callee Interaction specs initial connected connecting state machine spec Operator Assisted Call «uses» «uses» «provides» Can you depict this using balls & sockets?
Protocols: Reusable Interaction Sequences ( http://cot.uni-mb.si/ots2003/ppt/Selic-UML2.0-tutorial.030504.pdf) ,[object Object],[object Object],[object Object],Interfaces call ack number call ack talk transfer Caller Operator Callee
From Diagrams to Objects Collect all messages to define object’s methods and state transitions ! Phone Directory
State Transition Diagrams ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
State Transitions event name [guard condition] / action ^object/className.event 15 sec send ,[object Object],[object Object],[object Object],[object Object],[object Object],event name (a:T) [guard condition] / action
State Transitions initialization open add student [count<10] cancel cancel closed canceled add student/ set count=0;^CourseRoster.create(course) [count=10] ^CourseRoster.delete triggerless transition guard action event trigger send signal ,[object Object],[object Object],[object Object],[object Object]
State Transitions – notational variation open cancel closed canceled [count=10] open cancel closed canceled [count=10] open cancel closed canceled not cancel and [count=10]
Advanced States ,[object Object],[object Object],[object Object],[object Object],Tracking entry / setMode( onTrack ) exit / setMode( offTrack ) newTarget / tracker.Acquire() do / followTarget selfTest / defer entry action exit action internal transition activity deferred event name
Substates ,[object Object],[object Object],[object Object],Idle Maintenance Active Validating Selecting Processing Printing [not continue] entry / readCard exit / ejectCard [continue] sequential substate composite state maintain cardInserted cancel Idle Maintenance Testing Commanding Testing devices Waiting Self diagnosis Command maintain composite state concurrent substate [continue] join fork [not continue] keyPress Initial state/ pseudostate H H
Modular Submachines VerifyCard OutOfService acceptCard VerifyTransaction outOfService releaseCard ATM ReadAmount  : ReadAmountSM aborted rejectTransaction again usage of  exit point usage of  entry point invoked  submachine ReadAmountSM selectAmount EnterAmount ok abort aborted amount otherAmount abort again EXIT point ENTRY point Submachine definition http://www.xpdian.com/UML2.0changes.html ReleaseCard
Specialization ,[object Object],ATM acceptCard() outOfService() amount() Behaviour Statemachine FlexibleATM otherAmount() rejectTransaction() Behaviour Statemachine <<Redefine>>
Events – External vs. Internal Events ,[object Object],[object Object],System Event Event ,[object Object],1 NetworkElement elementPort: Port NetworkController consolePort[2..*] : Port
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],moveTo position velocity MovementAgent <<signal>> Collision force : float <<send>> send dependency Signal parameters signal Signals collision( force : float ) powerLoss powerDown TroubleManager ,[object Object],Events  – 4 Kinds:  Signals ; Calls; Passing of Time; Change in State
Call Events ,[object Object],[object Object],Automatic Manual startAutopilot( normal ) event parameter Time & Change Event ,[object Object],[object Object],[object Object],[object Object],[object Object],time event Idle Active when( 11:49pm ) / selfTest() after( 2 sec ) / dropConnection() change event Events  – 4 Kinds: Signals;  Calls; Passing of Time; Change in State
Modeling Family of Signals and Exceptions ,[object Object],[object Object],[object Object],<<signal>> RobotSignal <<signal>> HardwareFault <<signal>> Collision sensor : int <<signal>> MotorStall <<signal>> MovementFault <<signal>> BatteryFault <<signal>> VisionFault <<signal>> RangingFault ,[object Object],[object Object],[object Object],[object Object],[object Object],setHandler() firstHandler() lastHandler() <<exception>> Exception <<exception>> Duplicate <<exception>> Underflow <<exception>> Overflow add() remove() Set item <<send>> <<send>> <<send>>
Activity Diagrams ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Activity Diagram Basics ,[object Object],[object Object],[object Object],action  state : CertificateOfOccupancy [completed] object  flow Select site Commission  architect Develop plan Bid plan Do site work Do trade  work() Finish  construction initial state sequential  branch /decision [not accepted] [else] final  state concurrent fork activity state with submachine concurrent  join do construct() Entry/ setLock() triggerless transition guard expression No notational distinction between  action and activity states! But, activity states can have certain  types of parts  optional 0..*   AND one incoming, several outgoing merge  ( unbranch )  multiple incoming, one outgoing (for alternative threads)   OR
Swimlanes & Object Flow Request service Pay Collect order Take order Deliver order Fill order Customer Sales Stockroom Order [placed] Order [filled] Order [entered] Order [delivered] object flow ? ,[object Object],[object Object],[object Object],swimlane What if using pins? flow final the process stops at this point for this part of the activity diagram sub-activity indicator
Object Flows and Pins A shorthand notation: use input pins and output pins (parameters).  Invoice inv; inv = new Invoice; FillOrder(inv);
A Simple Example   – Order Processing <<precondition>> Order complete <<postcondition>> Order closed activity parameter node = object node What if using swimlanes?
A Simple Example   – Order Processing  Using sub-activity   Is this the same as the previous one?
Activity Diagram even as Method POEmployee.sortMail POEmployee.deliverMail POEmployee sortMail() deliverMail(k: Key) ad POEmployee.deliverMail Check Out Truck Put Mail in Boxes key ad POEmployee.sort-deliverMail
Interruptible Activity Region ,[object Object],[object Object]
An Activity Diagram   –  Distributing schedules <<signal>> redundant constraint object pin parameter http://www.agilemodeling.com/artifacts/activityDiagram.htm hour-glass symbol represents time   send receive send receive
Pins, Parameters, Effects (www.jot.fm/issues/issue_2004_01/column3.pdf ) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Multiple Tokens ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multiple Tokens - Ordering ,[object Object],[object Object],Non-Determinism  (http://www.jot.fm/issues/issue_2004_01/column3.pdf)
Parameter Multiplicity & Object Flow Weight ,[object Object],[object Object]
Interaction Overview Diagrams ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Interaction Overview Diagram   ( http://www.agilemodeling.com/artifacts/interactionOverviewDiagram.htm ) ,[object Object],[object Object],[object Object],[object Object],[object Object],sd Enroll in Seminar  lifelines :Student :Seminar :Course :Enrollment  :Student :Seminar :Course ref Select Seminar() getPrereq () isEligible(std) sd Determine Eligibility {0..7msec} [not eligible] :Seminar :Enrollment Number enrolled cd Determine Seat Availability ref AddToWaitingList() ref Enroll in Seminar() [seat available] [no seat]
sd Withdrawal :User :ATM :Bank ref Authenticate PIN OK PIN NOK withdraw msg (“amount”) amount (a) chkAcct (a) msg (“card”) msg (“illegal entry”) not enough bal msg(“amount too big”) Interaction Overview Diagram :User :ATM :Bank sd :User :ATM sd :User :ATM sd enough bal money receipt :User :ATM :Bank sd sd Relationship with Sequence Diagram?
Timing Diagrams ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Interaction Diagram:  Timing Diagram ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],critical states Timing constraints
Interaction Diagram: Timing Diagram (robust notation) http://www.visual-paradigm.com/highlight/highlightuml2support.jsp timing ruler w. tick marks   states   state timeline   transition point   Can you transform this into a concise notation?
Appendix: Miscellaneous
Role Names
Iterative Messages [Craig Larman] [http://www.phptr.com/articles/article.asp?p=360441&seqNum=6&rl=1]
Polymorphic Message [Craig Larman] [http://www.phptr.com/articles/article.asp?p=360441&seqNum=6&rl=1]
Sequence Diagram Shapes
 
Race conditions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
Sequence Diagram  - Reference   (www.cs.tut.fi/tapahtumat/olio2004/richardson.pdf)
State Machine Redefinition VerifyCard acceptCard ReleaseCard VerifyTransaction outOfService releaseCard OutOfService ATM { final } { final } { final } { final } ReadAmount selectAmount amount enterAmount ok reject { extended } otherAmount { extended } FlexibleATM
Interaction Diagram:  Timing Diagram (robust notation) A frame to bound the two lifelines  states/conditions   events/stimuli   transition point   message   state timeline   state timeline   timing ruler w. tick marks   timing constraint   timing observation
Timing Diagram – another example (www.cs.tut.fi/tapahtumat/olio2004/richardson.pdf)
Real-Time Extensions: Using CCS _timing?timeout ^_txport!data0 _timing: interface/connection ?: receive timeout: event ^: send _txport: interface/connection !: send data0: event +: multiple receive “ :”: multiple send

Weitere ähnliche Inhalte

Was ist angesagt?

Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
naina-rani
 
Lecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASELecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASE
babak danyal
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
koolkampus
 

Was ist angesagt? (20)

Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
Unit 4- Software Engineering System Model Notes
Unit 4- Software Engineering System Model Notes Unit 4- Software Engineering System Model Notes
Unit 4- Software Engineering System Model Notes
 
Presentation on uml
Presentation on umlPresentation on uml
Presentation on uml
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour Diagrams
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Lecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASELecture#02, building blocks of uml ASE
Lecture#02, building blocks of uml ASE
 
Object Modeling Techniques
Object Modeling TechniquesObject Modeling Techniques
Object Modeling Techniques
 
SE_Lec 05_System Modelling and Context Model
SE_Lec 05_System Modelling and Context ModelSE_Lec 05_System Modelling and Context Model
SE_Lec 05_System Modelling and Context Model
 
Unit 1( modelling concepts & class modeling)
Unit  1( modelling concepts & class modeling)Unit  1( modelling concepts & class modeling)
Unit 1( modelling concepts & class modeling)
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagram
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
 
Activity diagrams
Activity diagramsActivity diagrams
Activity diagrams
 
Object diagram
Object diagramObject diagram
Object diagram
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
State chart diagram
State chart diagramState chart diagram
State chart diagram
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
Domain Modeling
Domain ModelingDomain Modeling
Domain Modeling
 
UML
UMLUML
UML
 
Lecture04- Use Case Diagrams
Lecture04- Use Case DiagramsLecture04- Use Case Diagrams
Lecture04- Use Case Diagrams
 

Andere mochten auch

Uml Omg Fundamental Certification 5
Uml Omg Fundamental Certification 5Uml Omg Fundamental Certification 5
Uml Omg Fundamental Certification 5
Ricardo Quintero
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagrams
APU
 
October War_Effective Egyptian Preprarations Enable Strategic Surprise
October War_Effective Egyptian Preprarations Enable Strategic SurpriseOctober War_Effective Egyptian Preprarations Enable Strategic Surprise
October War_Effective Egyptian Preprarations Enable Strategic Surprise
W. Troy Ayres
 
Israeli-Palestinian Conflict
Israeli-Palestinian ConflictIsraeli-Palestinian Conflict
Israeli-Palestinian Conflict
theironegoodson
 
US in the Middle East Part 2
US in the Middle East Part 2US in the Middle East Part 2
US in the Middle East Part 2
skallens
 
The vietnam-war
The vietnam-warThe vietnam-war
The vietnam-war
keza123
 
1948 Arab–Israeli
1948 Arab–Israeli1948 Arab–Israeli
1948 Arab–Israeli
jakblack
 
Meloni
MeloniMeloni
Meloni
galcec
 
6 Day War
6 Day  War6 Day  War
6 Day War
Art 37
 

Andere mochten auch (20)

Anapersis
AnapersisAnapersis
Anapersis
 
Uml Omg Fundamental Certification 5
Uml Omg Fundamental Certification 5Uml Omg Fundamental Certification 5
Uml Omg Fundamental Certification 5
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagrams
 
The Invention of Nuclear Weapons
The Invention of Nuclear WeaponsThe Invention of Nuclear Weapons
The Invention of Nuclear Weapons
 
October War_Effective Egyptian Preprarations Enable Strategic Surprise
October War_Effective Egyptian Preprarations Enable Strategic SurpriseOctober War_Effective Egyptian Preprarations Enable Strategic Surprise
October War_Effective Egyptian Preprarations Enable Strategic Surprise
 
Conflicts in Egypt-2
Conflicts in Egypt-2Conflicts in Egypt-2
Conflicts in Egypt-2
 
27 NP Completness
27 NP Completness27 NP Completness
27 NP Completness
 
Israeli-Palestinian Conflict
Israeli-Palestinian ConflictIsraeli-Palestinian Conflict
Israeli-Palestinian Conflict
 
Red Star Over China (Speaker: Vincent Lee Kwun-leung) [Part 2]
Red Star Over China (Speaker: Vincent Lee Kwun-leung) [Part 2]Red Star Over China (Speaker: Vincent Lee Kwun-leung) [Part 2]
Red Star Over China (Speaker: Vincent Lee Kwun-leung) [Part 2]
 
Donald Wilhite, University of Lincoln: Integrated national drought management
Donald Wilhite, University of Lincoln: Integrated national drought managementDonald Wilhite, University of Lincoln: Integrated national drought management
Donald Wilhite, University of Lincoln: Integrated national drought management
 
US in the Middle East Part 2
US in the Middle East Part 2US in the Middle East Part 2
US in the Middle East Part 2
 
What happened to Gaza during the 1967 war?
What happened to Gaza during the 1967 war?What happened to Gaza during the 1967 war?
What happened to Gaza during the 1967 war?
 
WWI 5 Weapons
WWI 5 WeaponsWWI 5 Weapons
WWI 5 Weapons
 
The vietnam-war
The vietnam-warThe vietnam-war
The vietnam-war
 
Heroines And Heroes Of Sindh Long March
Heroines And Heroes Of Sindh Long MarchHeroines And Heroes Of Sindh Long March
Heroines And Heroes Of Sindh Long March
 
Chapter3
Chapter3Chapter3
Chapter3
 
1948 Arab–Israeli
1948 Arab–Israeli1948 Arab–Israeli
1948 Arab–Israeli
 
Meloni
MeloniMeloni
Meloni
 
6 Day War
6 Day  War6 Day  War
6 Day War
 
The Social Corporate Revolution
The Social Corporate Revolution   The Social Corporate Revolution
The Social Corporate Revolution
 

Ähnlich wie M03 2 Behavioral Diagrams

Memento Pattern Implementation
Memento Pattern ImplementationMemento Pattern Implementation
Memento Pattern Implementation
Steve Widom
 
Angular js meetup
Angular js meetupAngular js meetup
Angular js meetup
Anton Kropp
 
Software engg. pressman_ch-8
Software engg. pressman_ch-8Software engg. pressman_ch-8
Software engg. pressman_ch-8
Dhairya Joshi
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
soms_1
 
Intro to UML - Use Case diagrams
Intro to UML - Use Case diagramsIntro to UML - Use Case diagrams
Intro to UML - Use Case diagrams
jsm1979
 
Executability Analysis of Graph Transformation Rules (VL/HCC 2011)
Executability Analysis of Graph Transformation Rules (VL/HCC 2011)Executability Analysis of Graph Transformation Rules (VL/HCC 2011)
Executability Analysis of Graph Transformation Rules (VL/HCC 2011)
Elena Planas
 

Ähnlich wie M03 2 Behavioral Diagrams (20)

Oop2011 actor presentation_stal
Oop2011 actor presentation_stalOop2011 actor presentation_stal
Oop2011 actor presentation_stal
 
09 workflow
09 workflow09 workflow
09 workflow
 
Unit 1- OOAD ppt
Unit 1- OOAD  pptUnit 1- OOAD  ppt
Unit 1- OOAD ppt
 
Memento Pattern Implementation
Memento Pattern ImplementationMemento Pattern Implementation
Memento Pattern Implementation
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 
My Postdoctoral Research
My Postdoctoral ResearchMy Postdoctoral Research
My Postdoctoral Research
 
Angular js meetup
Angular js meetupAngular js meetup
Angular js meetup
 
SECh1214
SECh1214SECh1214
SECh1214
 
systemverilog-interview-questions.docx
systemverilog-interview-questions.docxsystemverilog-interview-questions.docx
systemverilog-interview-questions.docx
 
UML.pptx
UML.pptxUML.pptx
UML.pptx
 
Software engg. pressman_ch-8
Software engg. pressman_ch-8Software engg. pressman_ch-8
Software engg. pressman_ch-8
 
CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III CS8592 Object Oriented Analysis & Design - UNIT III
CS8592 Object Oriented Analysis & Design - UNIT III
 
How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?
 
Introducing Uml And Development Process
Introducing Uml And Development ProcessIntroducing Uml And Development Process
Introducing Uml And Development Process
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Intro to UML - Use Case diagrams
Intro to UML - Use Case diagramsIntro to UML - Use Case diagrams
Intro to UML - Use Case diagrams
 
Executability Analysis of Graph Transformation Rules (VL/HCC 2011)
Executability Analysis of Graph Transformation Rules (VL/HCC 2011)Executability Analysis of Graph Transformation Rules (VL/HCC 2011)
Executability Analysis of Graph Transformation Rules (VL/HCC 2011)
 
Matopt
MatoptMatopt
Matopt
 
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsSE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
 
Aggregation Functions in OCL
Aggregation Functions in OCL Aggregation Functions in OCL
Aggregation Functions in OCL
 

Mehr von Dang Tuan

Javascript for php developer
Javascript for php developerJavascript for php developer
Javascript for php developer
Dang Tuan
 
Power your web skills
Power your web skillsPower your web skills
Power your web skills
Dang Tuan
 
Ube Databases
Ube DatabasesUbe Databases
Ube Databases
Dang Tuan
 
Session02 Part Ii
Session02 Part IiSession02 Part Ii
Session02 Part Ii
Dang Tuan
 
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UMLPHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
Dang Tuan
 
M02 Uml Overview
M02 Uml OverviewM02 Uml Overview
M02 Uml Overview
Dang Tuan
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOAD
Dang Tuan
 
Object-Oriented Analysis & Design (OOAD) Domain Modeling Introduction
  Object-Oriented Analysis & Design (OOAD)  Domain Modeling Introduction  Object-Oriented Analysis & Design (OOAD)  Domain Modeling Introduction
Object-Oriented Analysis & Design (OOAD) Domain Modeling Introduction
Dang Tuan
 
Introduction to Modeling Java and UML
Introduction to Modeling Java and UMLIntroduction to Modeling Java and UML
Introduction to Modeling Java and UML
Dang Tuan
 
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
 Information Systems Analysis and Design Overview of OOAD, UML, and RUP Information Systems Analysis and Design Overview of OOAD, UML, and RUP
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
Dang Tuan
 
Ooad Overview
Ooad OverviewOoad Overview
Ooad Overview
Dang Tuan
 
M05 Metamodel
M05 MetamodelM05 Metamodel
M05 Metamodel
Dang Tuan
 
M04 Design Patterns
M04 Design PatternsM04 Design Patterns
M04 Design Patterns
Dang Tuan
 
M03 1 Structuraldiagrams
M03 1 StructuraldiagramsM03 1 Structuraldiagrams
M03 1 Structuraldiagrams
Dang Tuan
 
M01 Oo Intro
M01 Oo IntroM01 Oo Intro
M01 Oo Intro
Dang Tuan
 

Mehr von Dang Tuan (20)

Javascript for php developer
Javascript for php developerJavascript for php developer
Javascript for php developer
 
Power your web skills
Power your web skillsPower your web skills
Power your web skills
 
Ube Databases
Ube DatabasesUbe Databases
Ube Databases
 
Chapter1
Chapter1Chapter1
Chapter1
 
Chapter9
Chapter9Chapter9
Chapter9
 
Chapter7
Chapter7Chapter7
Chapter7
 
Chapter5
Chapter5Chapter5
Chapter5
 
Session02 Part Ii
Session02 Part IiSession02 Part Ii
Session02 Part Ii
 
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UMLPHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
PHÂN TÍCH VÀ THIẾT KẾ HỆ THỐNG DÙNG UML
 
Ooad Uml
Ooad UmlOoad Uml
Ooad Uml
 
M02 Uml Overview
M02 Uml OverviewM02 Uml Overview
M02 Uml Overview
 
UML for OOAD
UML for OOADUML for OOAD
UML for OOAD
 
Object-Oriented Analysis & Design (OOAD) Domain Modeling Introduction
  Object-Oriented Analysis & Design (OOAD)  Domain Modeling Introduction  Object-Oriented Analysis & Design (OOAD)  Domain Modeling Introduction
Object-Oriented Analysis & Design (OOAD) Domain Modeling Introduction
 
Introduction to Modeling Java and UML
Introduction to Modeling Java and UMLIntroduction to Modeling Java and UML
Introduction to Modeling Java and UML
 
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
 Information Systems Analysis and Design Overview of OOAD, UML, and RUP Information Systems Analysis and Design Overview of OOAD, UML, and RUP
Information Systems Analysis and Design Overview of OOAD, UML, and RUP
 
Ooad Overview
Ooad OverviewOoad Overview
Ooad Overview
 
M05 Metamodel
M05 MetamodelM05 Metamodel
M05 Metamodel
 
M04 Design Patterns
M04 Design PatternsM04 Design Patterns
M04 Design Patterns
 
M03 1 Structuraldiagrams
M03 1 StructuraldiagramsM03 1 Structuraldiagrams
M03 1 Structuraldiagrams
 
M01 Oo Intro
M01 Oo IntroM01 Oo Intro
M01 Oo Intro
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

M03 2 Behavioral Diagrams

  • 1. Module 3: Advanced Features – Part II: Behavioral Diagrams
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Interactions – conditional paths, asynchronous message [Craig Larman] [http://www.phptr.com/articles/article.asp?p=360441&seqNum=6&rl=1] :E unconditional :A :C :B :D 1: msg1 1a [test1]:msg2 2: msg7 1b [not test1]:msg3 1c: msg4 a.1:<<create>> 1a and 1b are mutually exclusive conditional paths 1c.1: msg5 active object asynchrous message a.2:update( p ) :F Is this ok? Can you produce a corresponding sd? Is there a unique sequence of paths?
  • 16.
  • 17. public Class Selection { private Purchase myPurchase = new Purchase(); private Payment myPayment; public void purchase() { myPurchase.buyMajor(); myPurchase.buyMinor(): myPayment = new Payment( cashTender ); //. .  } // . .  } :Selection :Purchase :Payment purchase buyMajor buyMinor create(cashTender) Sequence Diagrams & Some Programming
  • 18.
  • 19. sd Withdrawal :User :ATM :Bank ref Authenticate alt alt PIN OK PIN NOK withdraw msg (“amount”) amount (a) chkAcct (a) msg (“card”) msg (“illegal entry”) enough bal not enough bal money receipt msg(“amount too big”) sd Authenticate :User :ATM :Bank ref EnterPIN loop(0,3) PIN NOK msg (“try again”) cardId(cid) Idle ref EnterPIN sd EnterPIN :User :ATM :Bank PIN NOK pin-nok Digit[4] alt pin-ok PIN NOK Code(cid,pin) Frames: References continuation nested fragment operands operator
  • 20. sd Withdrawal :User :ATM :Bank ref Authenticate PIN OK PIN NOK withdraw msg (“amount”) amount (a) chkAcct (a) msg (“card”) msg (“illegal entry”) not enough bal msg(“amount too big”) Interaction Overview Diagram :User :ATM :Bank sd :User :ATM sd :User :ATM sd enough bal money receipt :User :ATM :Bank sd sd Relationship with Sequence Diagram?
  • 21.
  • 22. What can be in the top boxes? (http://www.agilemodeling.com/artifacts/sequenceDiagram.htm) Outputting transcripts Boundary/interface elements : software elements such as screens, reports, HTML pages, or system interfaces that actors interact with.  Control/process elements ( controllers ) : These serve as the glue between boundary elements and entity elements, implementing the logic required to manage the various elements and their interactions.  Often implemented using objects, but simple ones using methods of an entity or boundary class.  Entity elements
  • 23.
  • 24.
  • 25. From Diagrams to Objects Collect all messages to define object’s methods and state transitions ! Phone Directory
  • 26.
  • 27.
  • 28.
  • 29. State Transitions – notational variation open cancel closed canceled [count=10] open cancel closed canceled [count=10] open cancel closed canceled not cancel and [count=10]
  • 30.
  • 31.
  • 32. Modular Submachines VerifyCard OutOfService acceptCard VerifyTransaction outOfService releaseCard ATM ReadAmount : ReadAmountSM aborted rejectTransaction again usage of exit point usage of entry point invoked submachine ReadAmountSM selectAmount EnterAmount ok abort aborted amount otherAmount abort again EXIT point ENTRY point Submachine definition http://www.xpdian.com/UML2.0changes.html ReleaseCard
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. Object Flows and Pins A shorthand notation: use input pins and output pins (parameters). Invoice inv; inv = new Invoice; FillOrder(inv);
  • 42. A Simple Example – Order Processing <<precondition>> Order complete <<postcondition>> Order closed activity parameter node = object node What if using swimlanes?
  • 43. A Simple Example – Order Processing Using sub-activity Is this the same as the previous one?
  • 44. Activity Diagram even as Method POEmployee.sortMail POEmployee.deliverMail POEmployee sortMail() deliverMail(k: Key) ad POEmployee.deliverMail Check Out Truck Put Mail in Boxes key ad POEmployee.sort-deliverMail
  • 45.
  • 46. An Activity Diagram – Distributing schedules <<signal>> redundant constraint object pin parameter http://www.agilemodeling.com/artifacts/activityDiagram.htm hour-glass symbol represents time send receive send receive
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53. sd Withdrawal :User :ATM :Bank ref Authenticate PIN OK PIN NOK withdraw msg (“amount”) amount (a) chkAcct (a) msg (“card”) msg (“illegal entry”) not enough bal msg(“amount too big”) Interaction Overview Diagram :User :ATM :Bank sd :User :ATM sd :User :ATM sd enough bal money receipt :User :ATM :Bank sd sd Relationship with Sequence Diagram?
  • 54.
  • 55.
  • 56. Interaction Diagram: Timing Diagram (robust notation) http://www.visual-paradigm.com/highlight/highlightuml2support.jsp timing ruler w. tick marks states state timeline transition point Can you transform this into a concise notation?
  • 59. Iterative Messages [Craig Larman] [http://www.phptr.com/articles/article.asp?p=360441&seqNum=6&rl=1]
  • 60. Polymorphic Message [Craig Larman] [http://www.phptr.com/articles/article.asp?p=360441&seqNum=6&rl=1]
  • 62.  
  • 63.
  • 64.  
  • 65. Sequence Diagram - Reference (www.cs.tut.fi/tapahtumat/olio2004/richardson.pdf)
  • 66. State Machine Redefinition VerifyCard acceptCard ReleaseCard VerifyTransaction outOfService releaseCard OutOfService ATM { final } { final } { final } { final } ReadAmount selectAmount amount enterAmount ok reject { extended } otherAmount { extended } FlexibleATM
  • 67. Interaction Diagram: Timing Diagram (robust notation) A frame to bound the two lifelines states/conditions events/stimuli transition point message state timeline state timeline timing ruler w. tick marks timing constraint timing observation
  • 68. Timing Diagram – another example (www.cs.tut.fi/tapahtumat/olio2004/richardson.pdf)
  • 69. Real-Time Extensions: Using CCS _timing?timeout ^_txport!data0 _timing: interface/connection ?: receive timeout: event ^: send _txport: interface/connection !: send data0: event +: multiple receive “ :”: multiple send