240 likes | 255 Views
This communication diagram shows the process of adding a new advert to a campaign. It includes selecting a client, selecting a campaign, and adding the advert. The diagram also includes the steps for listing campaigns and adverts, as well as getting campaign and advert details.
E N D
communication diagram sd Add a new advert to a campaign 5: createNewAdvert 5.1: addNewAdvert 4: selectCampaign 4.1: showCampaignAdverts 3: selectClient 3.1: showClientCampaigns newAd:Advert :AddAdvert :AddAdvertUI :CampaignManager 2: startInterface 5.1.1: addNewAdvert 4.1.1: listAdverts 1 *[For all clients]: getClient 5.1.1.1: Advert 3.1.1: listCampaigns 3.1.1.1 *[For all client’s campaigns]:getCampaignDetails 4.1.1.1 *[For all campaign’s adverts]: getAdvertDetails :Campaign :Client :Advert listCampaigns 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: createNewAdvert 5.1: addNewAdvert 4: selectCampaign 4.1: showCampaignAdverts 4.1.2 *[For all campaign’s adverts]: getAdvertDetails 3: selectClient 3.1: showClientCampaigns :AddAdvert :AddAdvertUI :Advert 5.1.1: addNewAdvert :CampaignManager 2: startInterface 4.1.1: listAdverts 3.1.2 *[For all client’s campaigns]:getCampaignDetails 1 *[For all clients]:getClient 3.1.1: listCampaigns 5.1.1.1: Advert :Client :Campaign newAd:Advert listCampaigns message does not pass back any data from :Campaign in this alternative interaction
sd checkCampaignBudget checkCampaignBudget 2: getOverheads :Campaign 1*[For all adverts]: getCost The direction in which a link can be navigated may be shown if required. :Advert Navigation links
sdAdd a new advert to a campaign Interaction Constraint :CampaignManager :Client :Campaign :Advert getName listCampaigns Combined Fragment (loop) Interaction Operator loop [For all client’s campaigns] getCampaignDetails listAdverts loop [For all campaign’s adverts] getAdvertDetails addNewAdvert Advert newAd:Advert Lifeline Activation or Execution Object creation sequence diagram Frame label Sequence diagram is enclosed in a frame
sd Interaction Name State on lifeline showing pre-condition :LifelineB :LifelineA Synchronous (blocking) message Receive messaged Event Occurrence (msg.recieveEvent) Active Send message Event Occurrence (msg.sendEvent) msg a start of Execution Occurrence Execution Occurrence end of Execution Occurrence Message reply showing return of control
sd Add a new advert to a campaign :Client :Campaign :Advert :AddAdvert :CampaignManager [For all clients] loop getClient :AddAdvertUI startInterface selectClient showClientCampaigns listCampaigns [For all client’s campaigns] loop getCampaignDetails selectCampaign showCampaignAdverts listAdverts [For all campaign’s adverts] loop getAdvertDetails createNewAdvert addNewAdvert addNewAdvert Advert newAd:Advert Controllifeline Boundarylifeline
sd Delete advert :Advert :Campaign listAdverts loop getAdvertDetails deleteAdvert delete X Object destruction
sd Check campaign budget :CampaignManager :Client :Campaign :Advert getName listCampaigns loop [For all client’s campaigns] getCampaignDetails checkCampaignBudget loop [For all campaign’s adverts] getCost Reflexive message getOverheads
sd Check campaign budget :Client :Campaign :Advert :CampaignManager Shading showing the focus of control getName listCampaigns loop [For all client’s campaigns] getCampaignDetails checkCampaignBudget loop [For all campaign’s adverts] getCost getOverheads Reply with the return-value shown budget = checkCampaignBudget
sd Check campaign budget Object selector notation :CampaignManager campaign[i] :Campaign advert[j] :Advert :Client getName listCampaigns Interaction constraint refers to variable used in object selector notation loop [i=1;i<=campaign.count; i++ ] getCampaignDetails checkCampaignBudget [j=1;j<=advert.count; j++ ] loop getCost getOverheads
sd Check campaign budget :CampaignManager campaign[i] :Campaign advert[j] :Advert :Client getName listCampaigns loop (1, *) [i<=campaign.count ] getCampaignDetails checkCampaignBudget loop (1, *) [j<=advert.count ] getCost Interaction Operator with parameters getOverheads
sd Add a new advert to a campaign if within budget :CampaignManager :Client :Campaign :Advert getName listCampaigns ref List client campaigns ref Get campaign budget addCostedAdvert alt [totalCost <= budget] newAd:Advert Advert alt interaction operator shows branching [else] newRequest:Request Request Two interaction operands, one for each alternative
ref interaction operator indicates interaction occurrence that references an interaction fragment sd Check campaign budget :CampaignManager :Client :Campaign :Advert getName listCampaigns ref List client campaigns Gate showing the message enter this interaction occurrence ref Get campaign budget handling complexity
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 listCampaigns loop [For all client’s campaigns] getCampaignDetails
sd Get campaign budget Interaction fragment that is also referenced in Check campaign budget sequence diagram :CampaignManager :Campaign :Advert checkCampaignBudget loop [For all campaign’s adverts] getCost getOverheads
sdAdd a new advert to a campaign :ClientCampaigns ref ClientCampaignAds :AddAdvert :CampaignManager loop [For all clients] getClient :AddAdvertUI startInterface selectClient showClientCampaigns listCampaigns Lifeline representing the interaction between a group of objects selectCampaign showCampaignAdverts listAdverts createNewAdvert addNewAdvert addNewAdvert
sdClientCampaignAds :Client :Campaign :Advert getClient listCampaigns loop [For all client’s campaigns] Sequence diagram referenced in the Add a new advert to a compaign sequence diagram getCampaignDetails listAdverts loop [For all campaign’s adverts] getAdvertDetails addNewAdvert Advert newAd:Advert
sd Authorize expenditure sd Calculate costs :LifelineA :LifelineB :LifelineC :LifelineA :LifelineB :LifelineC getCost ref getCost Calculate costs alt [Within budget] ref Identify under spend alt [Within budget] Within budget Budget spent Budget spent Within budget authorize [else] [else] stopExpenditure Continuations are used to link sequence diagrams
sd Interaction Name An active object :ClassB :ClassA t = now Asynchronous message with duration constraint Time constraint using construction marks signalE {0..14} signalF {t..t + 28} Callback Duration observation signalX d = duration {d..d*3} Note explaining some aspect of this execution occurrence signalY Duration constraint
sd Add a new advert to a campaign if within budget sd List Campaigns for Client :CampaignManager :Client :Campaign getName listCampaigns loop [For all client’s campaigns] getCampaignDetails Initial node ref Get campaign budget Interaction occurrence In-line sequence diagram sd Add costed advert :Campaign :CampaignManager addCostedAdvert Decision [totalCost > budget] [totalCost <= budget] ref ref Create advert Create request Final node
sd Car enters car park :Barrier after:WeightSensor before:WeightSensor activate :TicketMachine Active ticketRequested raiseBarrier deactivate lowerBarrier barrierLowered Lowered Lowered Blocked Inactive Raised
sd Car enters car park lifelines :Barrier, :TicketMachine Sloped line represents duration of state change Timing Constraint {t..t+3s} Raised :Barrier Lowered barrierLowered Blocked Diagram has two instances, one for each lifeline raiseBarrier :TicketMachine Active Inactive t Message from one lifeline to another