UML - The Dynamic View: Sequence and Collaboration Diagrams
The Dynamic View Sequence Diagram Collaboration Diagram State Chart Diagram
Sequence Diagram [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 169. Wiley, New York , NY.
Collaboration Diagram [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 188. Wiley, New York , NY.
Sequence Diagram [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 170. Wiley, New York , NY.
Sequence Diagram [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 172. Wiley, New York , NY.
Object Creation [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 173. Wiley, New York , NY.
Collaboration Diagram [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 190. Wiley, New York , NY.
Collaboration Diagram [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 191. Wiley, New York , NY.
Sequence Diagram Example [1] Use the Scenarios from the Activity Diagram 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 180. Wiley, New York , NY.
Sequence Diagram Example [1] Define the Objects Participating in the given scenario 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 181. Wiley, New York , NY.
Sequence Diagram Example [1] … add messages 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 181. Wiley, New York , NY.
Sequence Diagram Example [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 182. Wiley, New York , NY.
Sequence Diagram Example [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 182. Wiley, New York , NY.
Sequence Diagram Example [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 183. Wiley, New York , NY.
Sequence Diagram Example [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 184. Wiley, New York , NY.
Sequence Diagram Example [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 184. Wiley, New York , NY.
Sequence Diagram Example [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 185. Wiley, New York , NY.
Collaboration Diagram Example [1] Use the Scenarios from the Activity Diagram 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 194. Wiley, New York , NY.
Collaboration Diagram Example [1] Define the Objects Participating in the given scenario 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 195. Wiley, New York , NY.
Collaboration Diagram Example [1] Link the Objects and … 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 195. Wiley, New York , NY.
Collaboration Diagram Example [1] … add collaborations 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 198. Wiley, New York , NY.
Collaboration Diagram Example [1] Or add links one by one as you add collaborations 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 196. Wiley, New York , NY.
Collaboration Diagram Example [1] Or add links one by one as you add collaborations 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 196. Wiley, New York , NY.
Collaboration Diagram Example [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 197. Wiley, New York , NY.
Collaboration Diagram Example [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 198. Wiley, New York , NY.
Mapping to the Class Diagram [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. pp. 200. Wiley, New York , NY.
Support Relationships [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. Wiley, New York , NY.
UML Views and Diagrams [1] 1) Pender, T.A. 2002. UML Weekend Crash Course. Wiley, New York , NY.
CRC Methodology
CRC Methodology “Classes, Responsibilities, Collaborations” methodology… … is not UML … is not a part of UML … does not use UML … , but can be used in support of UML
A Sample CRC Card[1] 1) Pender, T.A. 2002. UML Weekend Crash Course. Wiley, New York , NY.
The CRC Process[1] Before the Scenario Execution During the Scenario Execution After the Scenario Execution 1) Pender, T.A. 2002. UML Weekend Crash Course. Wiley, New York , NY.
Before the Scenario Execution[1] Define the problem Brainstorm for classes Define and filter classes Assign cards to members 1) Pender, T.A. 2002. UML Weekend Crash Course. Wiley, New York , NY.
During the Scenario Execution[1] “Simulate” scenarios to discover responsibilities Assign each responsibility to the proper class Identify similar classes, and group the cards Review the scenario list for completeness Draw collaborations between classes 1) Pender, T.A. 2002. UML Weekend Crash Course. Wiley, New York , NY.
After the Scenario Execution[1] Review the model Plan the implementation 1) Pender, T.A. 2002. UML Weekend Crash Course. Wiley, New York , NY.
Algorithms and Protocols
Algorithm Specified sequence of steps that Representation: accomplish a designated task in a finite number of steps Representation: simple algorithm: flowchart complicated algorithm: program
Example: One Turn at Monopoly Move token number of squares indicated on dice Start turn Throw dice Land on “go to jail”? Move to “jail” square Yes No Do not move; follow policies for square (like “pay rent”) Finish turn
Algorithm Building Blocks Start Start Start Programming languages support these three building blocks Action Action Decision Test Action Action Action Action Finish Finish Finish Loop Sequence Selection
Protocol Distributed algorithm realized by two or more modules to coordinate their actions or accomplish some shared task Module interoperability requires a protocol Prescribed order of method invocations Part of interface documentation
Monopoly Players Protocol One-turn algorithm This is a protocol interaction diagram Time
Application and infrastructure The application defines its own application-level protocols Internally, the network uses protocols to implement the services it provides
Three simple protocols One-way message: send-receive Two-way interaction: request-response Push: publish-subscribe
Client Server send receive request response subscribe responses Time
Example: HTTP User activates URL HTTP request HTTP response HTTP client (browser) HTTP server HTTP response (embedded document) Browser displays document (if HTML) or invokes “helper application” HTML documents
Example: Stock trading Customer wants to purchase 10 shares of MSFT if price is below $90 Customer StockTrader What is application protocol?
Locating Things
Three ways of locating things Name “John Doe” Address “1299 Rockville Pike, Rockville, MD” Reference “Postmaster of Rockville MD”
Name Symbolic (character string) representation Easy for people to remember or guess Identifies but does not locate directly Distinction important for mobile entities Not unique: entities can have more than one name (called aliases)
Hierarchical names Hierarchy makes names easier to remember or guess Host domain names: “info.sims.berkeley.edu” designates administrative hierarchy File names: “c:\My Documents\Docs\Resume.doc” designates folder hierarchy
Address Route or path to entity is directly specified, or can be inferred Independent of who or what is locating entity Topological specification
Example 4 3 1 2 Path from to is (1,2,2,2,1,1,1,1) Not an address, because it depends on starting point
Example (1,1) (1,2) (1,3) (1,4) (1,4) (2,1) (2,2) (2,3) (2,4) (2,5) Address of is (2,5) Route from can be inferred
Reference Abstract representation of an entity Interaction is with representation infrastructure arranges redirection to actual entity especially appropriate for things that move
Reference Client Server address
Name services 3. interaction 1. name 2. address or reference Name