communication diagram list Campaigns message may pass back

communication diagram list. Campaigns message may pass back too much data from : Campaign Notation for iteration different to that in sequence diagram sd Add a new advert to a campaign 5: create. New. Advert 5. 1: add. New. Advert 4: select. Campaign 4. 1: show. Campaign. Adverts 3: select. Client 3. 1: show. Client. Campaigns : Campaign. Manager new. Ad: Advert : Add. Advert. UI 2: start. Interface 1 *[For all clients]: get. Client 5. 1. 1: add. New. Advert 4. 1. 1: list. Adverts 5. 1. 1. 1: Advert 3. 1. 1: list. Campaigns : Client University of Toronto at Scarborough 3. 1. 1. 1 *[For all client’s campaigns]: get. Campaign. Details : Campaign © Bennett, Mc. Robb and Farmer 2005 4. 1. 1. 1 *[For all campaign’s adverts]: get. Advert. Details : Advert CSCC 40 communication and sequence diagrams 1

list. Campaigns message does not pass back any data from : Campaign in this alternative interaction sd Add a new advert to a campaign 5: create. New. Advert 5. 1: add. New. Advert 4: select. Campaign 4. 1: show. Campaign. Adverts 3: select. Client 3. 1: show. Client. Campaigns : Advert : Add. Advert. UI : Campaign. Manager 4. 1. 2 *[For all campaign’s adverts]: get. Advert. Details 2: start. Interface 1 *[For all clients]: get. Client 5. 1. 1: add. New. Advert 4. 1. 1: list. Adverts 3. 1. 2 *[For all client’s campaigns]: get. Campaign. Details 3. 1. 1: list. Campaigns 5. 1. 1. 1: Advert : Client University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 : Campaign new. Ad: Advert CSCC 40 communication and sequence diagrams 2

Message Labels Type of message Syntax example Simple message. 4: add. New. Advert Nested call with return value. The return value is placed in the variable name. 3. 1. 2: name = get. Name Conditional message. This message is only sent if the condition [balance > 0] is true. 5 [balance > 0]: debit(amount) Iteration University of Toronto at Scarborough 4. 1 *[For all adverts]: get. Cost © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 3
![Navigation links sd check. Campaign. Budget : Campaign 2: get. Overheads 1*[For all adverts]: Navigation links sd check. Campaign. Budget : Campaign 2: get. Overheads 1*[For all adverts]:](http://slidetodoc.com/presentation_image/23b2da1aed1842ddf3236f25c65d4ba6/image-4.jpg)
Navigation links sd check. Campaign. Budget : Campaign 2: get. Overheads 1*[For all adverts]: get. Cost The direction in which a link can be navigated may be shown if required. : Advert University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 4

sequence diagram sd Add a new advert to a campaign Interaction Constraint Frame label : Campaign. Manager : Client : Campaign : Advert get. Name Interaction Operator list. Campaigns loop Combined Fragment (loop) [For all client’s campaigns] get. Campaign. Details Sequence diagram is enclosed in a frame list. Adverts loop [For all campaign’s adverts] get. Advert. Details add. New. Advert Lifeline University of Toronto at Scarborough Advert Activation or Execution © Bennett, Mc. Robb and Farmer 2005 new. Ad: Advert Object creation CSCC 40 communication and sequence diagrams 5

sd Interaction Name : Lifeline. A Synchronous (blocking) message : Lifeline. B Active Send message Event Occurrence (msg. send. Event) msg a State on lifeline showing pre-condition Receive messaged Event Occurrence (msg. recieve. Event) start of Execution Occurrence end of Execution Occurrence Message reply showing return of control University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 6

Control lifeline sd Add a new advert to a campaign Boundary lifeline : Client : Add. Advert : Campaign. Manager loop : Campaign : Advert [For all clients] get. Client : Add. Advert. UI select. Client start. Interface show. Client. Campaigns list. Campaigns loop [For all client’s campaigns] get. Campaign. Details select. Campaign show. Campaign. Adverts list. Adverts loop [For all campaign’s adverts] get. Advert. Details create. New. Advert add. New. Advert University of Toronto at Scarborough add. New. Advert © Bennett, Mc. Robb and Farmer 2005 Advert new. Ad: Advert CSCC 40 communication and sequence diagrams 7

sd Delete advert : Campaign : Advert list. Adverts loop get. Advert. Details delete. Advert delete X Object destruction University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 8

sd Check campaign budget : Campaign. Manager : Client : Campaign : Advert get. Name list. Campaigns loop [For all client’s campaigns] get. Campaign. Details check. Campaign. Budget loop [For all campaign’s adverts] get. Cost get. Overheads University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 Reflexiv e message CSCC 40 communication and sequence diagrams 9

sd Check campaign budget : Client : Campaign : Advert : Campaign. Manager get. Name Shading showing the focus of control list. Campaigns loop [For all client’s campaigns] get. Campaign. Details check. Campaign. Budget loop [For all campaign’s adverts] get. Cost get. Overheads budget = check. Campaign. Budget University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 Reply with the return -value shown CSCC 40 communication and sequence diagrams 10
![sd Check campaign budget : Campaign. Manager Object selector notation campaign[i] : Campaign : sd Check campaign budget : Campaign. Manager Object selector notation campaign[i] : Campaign :](http://slidetodoc.com/presentation_image/23b2da1aed1842ddf3236f25c65d4ba6/image-11.jpg)
sd Check campaign budget : Campaign. Manager Object selector notation campaign[i] : Campaign : Client get. Name Interaction constraint refers to variable used in object selector notation list. Campaigns loop advert[j] : Advert [i=1; i<=campaign. count; i++ ] get. Campaign. Details check. Campaign. Budget loop [j=1; j<=advert. count; j++ ] get. Cost get. Overheads University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 11
![sd Check campaign budget : Campaign. Manager campaign[i] : Campaign : Client get. Name sd Check campaign budget : Campaign. Manager campaign[i] : Campaign : Client get. Name](http://slidetodoc.com/presentation_image/23b2da1aed1842ddf3236f25c65d4ba6/image-12.jpg)
sd Check campaign budget : Campaign. Manager campaign[i] : Campaign : Client get. Name advert[j] : Advert list. Campaigns loop (1, *) [i<=campaign. count ] get. Campaign. Details check. Campaign. Budget loop (1, *) [j<=advert. count ] get. Cost Interaction Operator with parameters University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 get. Overheads CSCC 40 communication and sequence diagrams 12

sd Add a new advert to a campaign if within budget : Campaign. Manager : Client : Campaign : Advert get. Name list. Campaigns ref List client campaigns ref Get campaign budget add. Costed. Advert alt interaction operator shows branching [total. Cost <= budget] Advert [else] Request new. Ad: Advert new. Request: Request Two interaction operands, one for each alternative University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 13

handling complexity ref interaction operator indicates interaction occurrence that references an interaction fragment sd Check campaign budget : Campaign. Manager : Client : Campaign : Advert get. Name list. Campaigns ref List client campaigns Gate showing the message enter this interaction occurrence ref Get campaign budget University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 14

Interaction fragment that is referenced in Check campaign budget sequence diagram sd List client campaigns Gate showing the message enter this Interaction Fragment : Client : Campaign list. Campaigns loop University of Toronto at Scarborough [For all client’s campaigns] get. Campaign. Details © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 15

Interaction fragment that is also referenced in Check campaign budget sequence diagram sd Get campaign budget : Campaign. Manager : Campaign : Advert check. Campaign. Budget loop [For all campaign’s adverts] get. Cost get. Overheads University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 16

sd Add a new advert to a campaign : Add. Advert : Campaign. Manager loop : Add. Advert. UI select. Client [For all clients] get. Client start. Interface show. Client. Campaigns select. Campaign create. New. Advert University of Toronto at Scarborough : Client. Campaigns ref Client. Campaign. Ads list. Campaigns show. Campaign. Adverts add. New. Advert Lifeline representing the interaction between a group of objects list. Adverts add. New. Advert © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 17

sd Client. Campaign. Ads : Client : Campaign : Advert get. Client list. Campaigns loop Sequence diagram referenced in the Add a new advert to a compaign sequence diagram [For all client’s campaigns] get. Campaign. Details list. Adverts loop [For all campaign’s adverts] get. Advert. Details add. New. Advert University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 new. Ad: Advert CSCC 40 communication and sequence diagrams 18

sd Authorize expenditure : Lifeline. A sd Calculate costs : Lifeline. B : Lifeline. C : Lifeline. A : Lifeline. C get. Cost ref get. Cost Calculate costs alt : Lifeline. B [Within budget] ref [Within budget] Identify under spend Within budget authorize [else] Budget spent stop. Expenditure Continuations are used to link sequence diagrams University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 19

sd Interaction Name An active object Time constraint using construction marks : Class. B : Class. A t = now sign al. E Asynchronous message with duration constraint {0. . 1 4} signal. F {t. . t + 28} Callback signal X d= du ration Duration observation {d. . d*3} Duration constraint University of Toronto at Scarborough l. Y signa © Bennett, Mc. Robb and Farmer 2005 Note explaining some aspect of this execution occurrence CSCC 40 communication and sequence diagrams 20

Interaction Operator alt opt break Explanation and use Alternatives represents alternative behaviours, each choice of behaviour being shown in a separate operand. The operand whose interaction constraint is evaluted as true executes. Option describes a single choice of operand that will only execute if its interaction contraint evaluates as true. Break indicates that the combined fragment is performed instead of the remainder of the enclosing interaction fragment. par Parallel indicates that the execution operands in the combined fragment may be merged in any sequence once the event sequence in each operand is preserved. seq Weak Sequencing results in the ordering of each operand being maintained but event occurrence from different operands on different lifelines may occur in any order. The order of event occurrences on common operands is the same as the order of the operands. strict neg Strict Sequencing imposes a strict sequence on execution of the operands but does not apply to nested fragments. Negative describes an operand that is invalid. critical Critical Region imposes a constraint on the operand that none of its event occurrences on the lifelines in the region can be interleaved. ignore Ignore indicates the message types, specified as parameters, that should be ignored in the interaction. consider assert loop University of Toronto at Scarborough Consider states which messages should be consider in the interaction. This is equivalent to stating that all others should be ignored. Assertion states that the sequence of messaging in the operand is the only valid continuation. Loop is used to indicate an operand that is repeated a number times until the interaction constraint for the loop is no longer true. © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 21

sd Add a new advert to a campaign if within budget sd List Campaigns for Client : Campaign. Manag er : Client get. Name : Campaign list. Campaigns loop [For all client’s campaigns] get. Campaign. Details Initial node ref Get campaign budget Interaction occurrence In-line sequence diagram sd Add costed advert : Campaign. Manag er : Campaign add. Costed. Advert Decision [total. Cost <= budget] ref Create advert [total. Cost > budget] ref Create request Final node University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 22

sd Car enters car park before: Weight. Sensor : Ticket. Machine activate : Barrier after: Weight. Sensor Lowered Active ticket. Requested raise. Barrier deactivate Raised lower. Barrier Blocked Lowered barrier. Lowered Inactive University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 23

Sloped line represents duration of state change Diagram has two instances, one for each lifeline : Barrier sd Car enters car park lifelines : Barrier, : Ticket. Machine Raised Timing Constraint {t. . t+3 s} Lowered Message from one lifeline to another : Ticket. Machine barrier. Lowered Blocked raise. Barrier Active Inactive t University of Toronto at Scarborough © Bennett, Mc. Robb and Farmer 2005 CSCC 40 communication and sequence diagrams 24
- Slides: 24