UML of use case diagram correct? Extension or generalization? - uml

I have been trying to understand it but I couldn't. Can someone explain this shortly? Is there some problem with this UML diagram? If there is, where?
I thought that instead of extending arrows there might be a generalization for the pic, video, tag names, and feeling use cases. And I think that included arrows should have been dashed. Are these true? Thank you already.

You can not understand this since it is absolute nonsense. This is some semi-activity diagram. A use case is about actor goals, not how to do something. Please give the author of that a heavy kick in the rear. Or if you not that rude as myself (being a pacifist with empasis on fist - haha) just encourage them otherwise to start learning about use cases.
As always I recommend reading Bittner/Spence about use cases.

The following aspects of the diagram violate the UML specifications:
The boundary box shall represent a system (e.g. Facebook), not a function (Add Status).
Keywords include and extend shall be written in guillemets: «include», «extend».
The «include» arrows shall be dashed.
The «include» arrows shall have open arrow-heads.
To apply the use case technique in a project, the team shall agree on a specific methodology and/or philosophy. UML doesn't offer this, it is just a language (despite some definitions in the UML specification that point in a certain direction). Therefore, I will not give my opinion on whether this is a proper way of use case modeling.
With regard to generalization versus extension: both are possible in this case. If "Add Status" would mean: add pic or add video or etc., then a generalization would be more appropriate. The extension suggests that "Add Status" means: add pic and/or video and/or etc. In other words, each extending use case extends the original with additional capabilities.

Related

Is my use of inheritance and extended stereotype correct in this Use Case

The use case should depict this situation:
A shipman can ask questions via radio to either a VL, DM or WL. Depending on the question, they need to look it up in APIC (a software tool), but this is not always the case. They all are apic operators, but depending on their role, they have their speciality that they only can access in apic.
The question the shipman asks can be about lock executions, the nautical weather, etc... but it all comes down to the same question-answer format.
Is my use case correct?
Asking a question is usually not a use case. The goal of the shipman is probably not to ask a question, but to get some answers. So asking and anwering is one use case.
When analysing the use case, several possibilities will show up, such as looking up information in the APICS-system. I would just describe this within the use case (possibly with an Activity Diagram). What is the advantage of using an extend here? (I agree with the other answer, that the arrow is in the wrong direction. Additionally it should be an open arrow).
Each goal is an own use case, even when they have much in common. After describing the essential steps of the use cases, it may save some work to look at them and find those that have a big overlap in the essential steps and then create an abstract use case containing the commonalities. But this should only be done after describing the use cases.
Always remember, that the main goal of use case analysis is to find all functional requirements for the system, especially those that are not immediately obvious. If your use cases are just wrappers of functions you already know, not much insight is gained by them.
Three issues here:
The extends arrow is the wrong way around.
Generalizations of UCs is a bad idea in general.
Just as a side note: your actors miss their legs. This way it's a Female symbol (Venus' mirror).
Let's elaborate a bit on the 2nd. Why is it a bad idea? UCs represent a single added value for an actor a system under consideration will deliver. So each UC is unique (think of unique sales propositions). Generalization of USP is only valid in a franchise. So unless you model McDonalds here, it's likely a wrong approach. Look at the main UC "ask question". Do you consider that added value from a system? I wouldn't. When looking at the bubbles behind they more look like primary use cases. So, just remove that general "ask question" and connect the bubbles behind directly with Shipman.
As always when it comes to UC questions: Bittner/Spence about UC is the best read I can recommend.

Why is it said "Collaboration" realizes "Use case" rather than vice versa?

I am studying UML. I have some confusion about realization and collaboration.
Consider the diagram (I hope diagram is correct)
"Make a call" is a collaboration. "connect to destination" is a use case.
According to the book and various resources, I read that we say "Make a call" realizes "Connect to destination".
But as far as I understand, Collaboration is a logical concept we use to group a repetitive pattern(as in design patterns). The use cases(which have their own diagrams) are the ones who implement them (indirectly, as use cases will eventually have an related class diagram. those classes must be implementing them).
So shouldn't we say that "Use cases" realize "collaboration"?
What am I getting wrong here?
The source of confusion is java, where we have interfaces, and classes which implement them. we say a class implements interface. Isn't realization same as implementation?
What adds to this confusion is collaboration diagram, which seems to have nothing to do with collaboration.
Because you first have the use case. It roughly tells what the added value of the system is. And there's also a story how this value is achieved. Now you start thinking about how the system under consideration (SUC) an realize (hence the name) this use case. So you construct collaborations where you show how the class design working towards fulfillment of the single goals in use cases. You can have multiple collaborations to either show different aspects or variants of the SUC.
Regarding your diagram: you have dependencies from Connect to destination to two other use cases. That's not correct. Use cases represent individual added value the SUC brings to its actors. So they basically can not depend on each other. All use cases of the SUC represent the total added value. Often people try functional decomposition with use cases and add a lot of include/extend dependencies. That does not lead to meaningful use cases and you loose focus. That is, you don't show the added values but stray around technical possibilities.

use case diagram how do it better

hello, my first question is how I can place cases to better readability? I want to make this diagram fit on a A4-sized paper.
But I am aware that this diagram may be badly made, so I ask you to advice, maybe I should share on the smaller part?
You need to to connect a use case only to its primary actor. So eventually you have to create a common role where the UC is used by this common actor role. Then your specific actors inherit from this common one. Like in #Amir's example International Student inherits from Student.
I'd simply up-vote the latter example but it has <<include>>/<<extend>> which is no favorable with use case synthesis. Moreover it uses a generalization which is very bad practice with UCs since a UC represent an individual added value and inheritance from added value does not make sense (unlike in a class context).
I don't understood your language (In your use-cases). Generally most of time we have some common feature so You can use inheritance in UML diagram. For example if you have different kinds of students (or Actors) that have some common feature you can do something like below picture:
I think there is too many of use cases. I had the same problem. Try using CRUD - https://books.google.co.uk/books?id=gKHfVZn1CkgC&pg=PA367&lpg=PA367&dq=crud+use+cases&source=bl&ots=g7C2qnzunP&sig=F3OtpNWT29NFyqFvmO-MBtTG98k&hl=en&sa=X&ved=0ahUKEwjAmKifh9_OAhWpCsAKHV9pA344ChDoAQg4MAU#v=onepage&q&f=false
Also, you can divide your diagram into few use case diagrams for each actor. Or put all actors on the one side of the diagram and use cases on other. Hope this helps.
I completely agree with the given suggestions (CRUD, inheritance and responsibility by roles) and I additionally recommend not to try to create an overview about the whole universe. Instead, try to separate your use cases into groups based on similarities, differences etc. and explain your modeling on smaller pieces.
Avoid too complex structures and mutual/cyclic dependencies - they are almost always a sign of poor design. Remember, you have to implement and test every connection in your diagram somehow. Less connections, less effort, less errors.

Is the Sequence Diagram per use case in UML or we draw it for the System in general?

I discuss with my friend our project and we are in a way to draw the sequence diagram ( UML 2).
He told me that the sequence diagram is drawn by the use case. It means that for each use case we should draw a Sequence Diagram.
Is it correct ?
Thank you for any suggestion.
Well, taken as dogma it is not correct. A sequence diagram (SD) shows the behavior of objects in the way they interchange messages (and also if needed their lifetime and some minor additional information). You "can" also use a sequence diagram to describe scenarios in use cases. But simply speaking, a SD is more technically oriented (class design/programmers) rather than business (business design/stakeholders). To visualize a use case scenario you're better off using activity diagrams (AD). And even better if you dive into BPMN (which brings ADs to a new level).
It is possible though, to convert ADs to SDs and vice versa without information loss (if you forget about the afore mentioned bits and pieces).
Now another point: you will not necessarily need a diagram for each use case. I found that often use cases are more easily (and even clearly) described in a textual way (see Cockburn or Bittner/Spence) rather than diagrammatically. Especially if you have UC scenarios that are very linear in their single actions. So you can leave out the AD for those and just fall back to simple text. You should further avoid describing UC scenarios in both ways (i.e. text and diagram) as this introduces unwanted redundancy (means you would need to maintain always both when changes happen; and they happen often; and people are lazy -> so which one holds the truth: text or diagram?).
Generally, as Thomas points out, use case detail is set forth in an activity diagram. As he also mentions, a use case scenario would use a sequence diagram, when necessary. A use case scenario is a single path through a use case.
Sequence diagrams aren't good at diagramming multiple simultaneous behaviors and multiple decision points, and use cases generally have both of these features in their behavior. Activity diagrams do these things very well. A single path through a use case, by definition, doesn't have simultaneous behaviors and decision points, so a sequence diagram is more appropriate.
Googling "use case scenario sequence diagram" gives a number of links that explain the use of sequence diagrams for use case scenarios in detail, of which this is an example.
UseCase is declaration of behavior (service or usefull behavior) of system which is executed by system with collaboration (interaction) with system's actors.
Any type of diagram defined in UML could by used to describe behavior on any level of abstraction. All of diagrams could be also used to describe both business or technical aspects of system.
UseCase is declaration of behavior, it means that UseCase does not define behavior at all. UML does not define scenarios of UseCase ,scenarios are usually defined in methodology not in UML.
If you need to describe behavior of system in context of UseCase you can use some of behavior diagrams defined in UML for each UseCase.

sequence diagram used as a use case

Has anyone ever seen a sequence diagram used as a use case? I never have and it really twists my head. At my current company, in all the documentation and discussions, the term "use case" is used to label a sequence diagram. I've asked a couple of times about this practice and get funny looks like it is a normal thing to do. - I've been a software engineer for a long time and used UML since the late 1990's when it was first (fairly) widely talked about. I don't expect to change the company culture. I'm just asking if this practice is used anywhere else and associated comments. - Thanks.
In my university, we learned that a use case diagram and a sequence diagram are both different diagrams with different meanings. In my experience, I have never heard anyone calling a sequence diagram a use case diagram or vice versa so I guess it's just the company culture...
Sequence Diagrams are typically used to describe an example of an action flow with communication. Thus Sequence Diagrams are very well suited to display an example for a use case. For this reason it is normal to refer to such a diagram as "a use case".
In consequence you would draw multiple Sequence Diagrams for each Use Case

Resources