UML用例技术咨询:如何绘制参与者不可访问及异常场景用例?
Answers to Your UML Use Case Questions
1. How to Represent Use Cases Unavailable to a Participant?
UML doesn’t have a rigid, one-size-fits-all symbol for this scenario, but there are two practical, team-friendly approaches that are widely used:
- Stereotype with visual cues: Apply a custom stereotype like
<<Unavailable>>to the use case shape, then visually flag it (e.g., gray out the box or draw a diagonal line through it). This makes it instantly clear that the participant can’t access this functionality at all. - Explanatory note links: Attach a UML note (the yellow sticky-style shape) directly to the use case, spelling out details like "This use case is inaccessible to [Participant Name] because [specific reason, e.g., permission restrictions]". This works great if you need to add context for why access is blocked.
The biggest rule here is consistency—pick one method and stick with it so your whole team interprets the diagram the same way.
2. Use Case Diagram for Web-Based Security Camera Control (Including Network Interruptions & Failed Pan Operations)
Let’s break this down for your scenario step by step:
First, lay out your core components:
- Participant:
Web Browser User - Core use cases:
Control Camera Pan,Capture Snapshot
For the exception scenarios you’re asking about:
- Network interruption during Pan: Create an extension use case called
Handle Network Interruption, then draw a dashed arrow from this extension use case toControl Camera Pan. Label the arrow with<<extend>>, and add a trigger condition like[Network connection lost mid-operation]. This tells anyone reading the diagram that if the network drops while the user is trying to pan, this exception flow activates. - Failed Pan operation (non-network causes): If the Pan could fail for other reasons (like a camera hardware glitch), make another extension use case
Handle Pan Operation Failure. Link it toControl Camera Panwith an<<extend>>arrow, and note the trigger condition as[Camera fails to execute Pan command].
If you prefer a simpler setup, you could also attach notes to the core use cases explaining these exceptions. But using extension relationships makes the diagram more structured and easier to follow for complex systems.
内容的提问来源于stack exchange,提问作者Nick
相关产品推荐
相关产品推荐

