Search code examples
umldiagramuse-casediagramming

How to graphically represent a UML use case extension point?


I have a use case that is associated with two actors in a system. This use case extends another use case, but only one of the actors can use the extended use case.

Is there some way to represent the conditional nature of the extension of the first use case? Or, do I need to specify in the use case documentation that the initial use case can only possibly be extended for one kind of actor?

Thanks.


Solution

  • If I understand the question, it sounds like you need two kinds of actor. You (possibly) need to make one actor type a generalisation by abstraction. To put it another way, you need to create a specialised actor who inherits permissions of the more general actor.

    ( Please excuse my horrible ascii people and generalisation arrow!)

        O                 __________________
       ---               /                  \
        |     -----------|   Use Case 1     |
       / \               |__________________|
                         | extension points |
       User              |   if Super User  |
        ^                \__________________/
       / \                        /\
      /___\                        | <<extend>>
        |                          | (if Super User)
        |                          |
        |                          |
        O                 _________________
       ---               /                 \
        |     -----------|   Use Case 2     |
       / \               \_________________/
     Super User         
    

    This specialised actor (Super User) can then engage in both use cases, but the normal user only the first one (the non-extending use case).

    Note that a Super User may or may not be able to initiate directly use case two. It depends on the use case and the problem domain as to whether that makes sense or not.

    You then probably want to use an extension point (something like "Super User" or "if Super User") in the extended use case which creates a decision point to the extending use case.

    Here's an example of a more legible diagram.

    Also here's the definition of extension point from The UML Reference Manual (2nd Edition) (p358):

    A named marker that identifies a location or set of locations within the behavioural sequence for a use case, at which additional behaviour can be inserted.

    The name of the extension point name can be whatever you want. Whatever makes sense to you. There are no syntactic rules. Whatever you put on the diagram should appear somewhere in a textual use case description (i.e., the steps of the use case).