简体   繁体   中英

Use case diagram: actor with more permissions

Regarding Use-Case Diagram: Consider 2 kinds of actors: Customer & User. Customer is a User (generalization) I want to model the use case of a Search option for items ('search items') which is allowed for all users without the need for a login : but only a customer (because he is registered) could take part in the use case add items . note that this means that the customer will also need to be logged in for this to happen. I can't seem to make it work without messing up the whole diagram. Thanks!

Simply add a constraint to the use case. You can make that visible in a diagram by using a constraint element which looks like a note but has the text enclosed in curly brackets.

As is noted in the specs :

NOTE. An Actor does not necessarily represent a specific physical entity but instead a particular role of some entity that is relevant to the specification of its associated UseCases. Thus, a single physical instance may play the role of several different Actors and, conversely, a given Actor may be played by multiple different instances.

Thus there is no reason to try to mash multiple use cases into single Actor; User and Customer represents two different roles and thus it is often better to represent it by two actors; the fact that Customer is derivation of User can represented by a generalization.

And finally you can add a note to the use-case association to specify that the Customer has to be logged in - but at least for me this seems unnecessary, because the User already had to log in in order to take on the "Customer" role.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM