150 likes | 171 Views
Use Case Maps (UCMs) and UML Use Case Diagrams. SEG3201 Fall 2006. Include Relationship. Helps to clarify a use case by isolating and encapsulating complex details and by improving consistency. Base use case requires included use case for completion
E N D
Use Case Maps (UCMs) and UML Use Case Diagrams SEG3201 Fall 2006
Include Relationship • Helps to clarify a use case by isolating and encapsulating complex details and by improving consistency. • Base use case requires included use case for completion • Solution: Use static stubs on the path representing a base use case. • Stubs hide the details contained in their plug-ins (the included use case) • The plug-in can be reused in multiple stubs, hence improving consistency among the UCMs.
« include » Originating « include » OCS Call Terminating « include » Terminating Terminating Originating Basic Call ring ring req req msg msg OCS OCS Call Include Relationship: Example BasicCall
Extend Relationship • Shows that part of a use case is: • (potentially) optional; • executed only under certain conditions; • inserted at an extension point in a base use case; • not required for the completion of base use case. • Solution: Use (guarded) OR-forks or dynamic stubs on a base use case. • Extension points are visual. • For dynamic stubs, there is a default plug-in that represents the original base case.
« extend » BusyTreatment « extend » OCS Feature upd [idle] Originating ring req Basic Call [busy] mb msg OCSlist chk [allowed] in1 out1 out1 in1 md [denied] out2 Default plug-in OCS plug-in Extend Relationship: Example BasicCall SelectionStrategy
Generalization Relationship • Used when two or more use cases have commonalties in behavior, structure, and purpose. The shared part can then be described in a new parent use case specialized by child use cases. • Solution: Use OR-joins and OR-forks, or multiple dynamic stubs. • Parent use case contains dynamic stubs for diverging behavior. • Child use case is parent + plug-ins.
Basic Call OCS Call UserO AgentO AgentT UserT Originating PhoneSession ring req msg Basic Call = Phone Session + Originating plug-in OCS Call = Phone Session + OCS plug-in Generalization Relation:Example PhoneSession
Elevator Control System [not requested] [moving] moving motor up door close decide on direction motor down in elevator [stationary] press number [requested] add to list motor stop no requests door open [more requests] [else] remove from list at requested floor Arrival Sensor approaching floor User Select Destination The elevator control system is adapted from Hassan Gomaa (2001) Designing Concurrent, Distributed, And Real-Time Applications with UML. Addison Wesley p459-462.
Elevator Control System [not requested] at floor [moving] moving motor up select elevator door close decide on direction motor down [stationary] press up/down [requested] add to list motor stop no requests door open [more requests] [else] remove from list at requested floor Arrival Sensor approaching floor User Request Elevator
at floor in elevator press up/down press number remove from list User Elevator Control System [not requested] [moving] moving motor up select elevator door close decide on direction motor down [stationary] [requested] add to list motor stop no requests door open [more requests] [else] at requested floor Arrival Sensor approaching floor Both Use Cases
at floor in elevator press up/down press number stationary remove from list Service Personnel switch on User Elevator Control System [not requested] [moving] moving motor up select elevator door close decide on direction motor down [stationary] [stat.] [requested] add to list motor stop no requests door open [more requests] [else] at requested floor Arrival Sensor approaching floor Both Use Cases + Switch On
at floor Stop Elevator at Floor [moving] OUT1 IN2 Dispatch Elevator IN1 OUT1 IN1 in elevator press up/down press number stationary motor stop door open remove from list Service Personnel switch on User Elevator Control System [not requested] moving motor up select elevator door close decide on direction motor down [stat.] [requested] add to list at requested floor Arrival Sensor approaching floor Included Use Cases
User Request Elevator Select Destination IN1 OUT1 IN1 OUT1 start walk_OUT walk_IN end Request Elevator bindings: IN1 … at floor OUT1 … at requested floor Select Destination bindings: IN1 … in elevator OUT1 … at requested floor High Level UCM
at floor in elevator press up/down press number User Scheduler [requested] Arrival Sensor [not requested] approaching floor moving select elevator [moving] Elevator add to list decide on direction door close [stat.] stationary motor up motor down remove from list at requested floor Service Personnel motor stop switch on Arch. Alternative (I) door open
at floor in elevator press up/down press number User Status&Plan [not requested] [requested] Scheduler select elevator Arrival Sensor Elev. Control approaching floor moving Elev. Mgr [moving] Elevator decide on direction [stat.] door close Status&Plan stationary add to list motor up remove from list motor down at requested floor Service Personnel switch on motor stop Arch. Alternative (II) door open