Use case for multiple login option

2019-02-28 09:01发布

问题:

I have a use case where user may log in via normal login, as well as social login such as Twitter, Google, Facebook. I draw the use case as below but not sure if it is correct.

Login account ---extends---> normal login
---extends---> Twitter login
---extends---> Google login
---extends---> Facebook login

回答1:

The <<extends>> works vice versa.

I'm quite tired telling this all the time, but Login account is not a use case. It does not deliver any value to an actor. It is a simple constraint which applies to other real use cases.

Further: avoid the use of <<extends>>/<<include>>. They are a sign of functional analysis you are trying to do with your use cases. Instead use cases are synthesized which makes a big difference. If your use case diagrams start resembling a spider's web your design is broken.

Recommended read: Bittner/Spence.



回答2:

In general I tend to agree with Thomas Kilian to be careful with use cases for loggin in as they generally do not pass the boss test.

Will my boss be happy if I do [--insert use case--] 100 times?

But use cases are used in many different ways, and for many different systems. If your system is authentication service then I guess Log In might be an important use case.

Anyhow, the extend relations are pretty much wrong. There is also a heated debate in the community on what extends really means, and how to use it. I usually advice not to use extend at all. But if you want to keep them then you probably need to do it the other way around.

The extending use case inserts some specific functionality to the extended use case at a specific point in the execution of the extended use case (the extension point). The extended use case has no knowledge of the extending use case(s).

Extends is probably not what you need here.

I would probably not go into that much detail, and stick to the single Log in use case (if any). You could make alternate scenario's for facebook, twitter, google, etc...

But if you really need this much detail in your use case model then I would use generalization

As you can see there is one abstract use case Log in. The three other concrete use cases inherit from this use case.

In analyses there are no right or wrong answers. There are only better or worse answers, and it all depends heavily on the purpose of your model.



回答3:

I think your use cases are a little too technical. When you're identifying use cases, you need to go back over them a few times to make sure the complete set of uses cases is meaningful. This often means some use cases are merged into a single one, others are split, etc.

The key question to ask when differentiating use cases is "is the difference between these two use cases meaningful to the actor?" You should not be asking "are there different ways to achieve this functionality?" or "will the implementation need to support several different protocols?" These are design issues, which should be documented not in the use cases but in the collaborations which realize them. Realizing one use case with several different alternative collaborations is perfectly valid and normal use of UML.

In this case, does it matter to the user how they log in or is it only important that they log in? I suspect the latter, in which case there should only be one use case.



标签: uml use-case