drawing use case diagram for device driver [closed] - uml

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to write use case diagram for a wireless NIC driver. There is no direct interaction of the user with the driver. How can one write use case diagram for drivers?

The 'user' in a use case is not necessarily a person hitting keys or anything. It is an 'actor' external to the system being described who can interact with the system being described.
Here, such actors could include routers or other bits of hardware that your NIC wants to connect to or that want to connect to it; it includes the hardware and OS the NIC is plugged into which the NIC exchanges signals with; and devices it is connected to and the signals they exchange.
Use cases would include:
The NIC detects available routers....
The NIC receives a request from......
Et cetera, to cover what you want the NIC to do.

Extending the previos 2 answers with a bit more info and an example...
The key aspect of the use case model is its context, or the system scope (depicted with a Boundary element on the diagram itself - see example). Everything that is "inside" the scope is abstracted by a UC and everything from the "outside" is modelled by an actor (human or system). Use cases model the interaction, the dialogue, the exchange of information between the two of them.
I see at least two system actors in your case, a controlled device and a client program. Another possible actor has been added in the following example, to show some eventual periodic communication with the device through the driver:
This is a very nice example on how different UML diagrams play together to show the whole truth. UC diagram focuses on the meaningful interactions between the System and its environment, showing no technical info about it.
In order to do this you need another diagram (here component, but classes are also ok, even both). This diagram is the place to define interfaces, APIs, method signatures, dependencies...
You can of course go a step further and use a sequence/interaction diagram to connect the Use cases with the corresponding components (on my example are only shown the "traces" to clear up which actors are implemented by which components). Something like this:
Note that something called "Data" is sent to the Driver (and the Device). This can further be defined in a class diagram, making a whole new point of view on this system.
It is common practice to put all this info in use case description. Although this approach might even be syntatically correct, the full power of UML is released by separating the concerns in different diagrams, keeping each one as simple and clear as possible, focused on only one concern and clean of others.

In your scenario Actor is system. You can include a system into use case as an actor, if that system is outside of the system you are developing and if it directly interacts with that system you are developing.
You may also need to define boundary of your system, which means its scope and interfaces. For example: you may want to create an actor for Routers. Preferable actions would be how they will interact with the driver of yours, as they are directly interacting with the system you are developing.
Hope this helps.
If you need further explanation with example, please comment below.

Related

Use case diagram with two different front ends [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am trying to model a use case diagram with two different front end applications. I have a web-based front end with different use cases than my front end for a tablet app. Some use case might have the same name but a different scenario.
My question is if it is a good way to use two system blocks in the diagram for each front end, or should I combine all uses cases in one system block? How can I model it in a UML correct and clear way?
UML use-cases and their boundaries
Setting the right boundaries is key to successful use-case modelling. According to the UML 2.5.1 specs:
A UseCase is a kind of BehavioredClassifier that represents a declaration of a set of offered Behaviors. Each UseCase specifies some behavior that a subject can perform in collaboration with one or more Actors. UseCases define the offered Behaviors of the subject without reference to its internal structure.
What matters is the system (i.e. the "subject" in use-case speak), the actors, and the behaviors that the subject offers to its actors (which, as QwertySO reminds us, supposed to provide value to the users, i.e. help to achieve the user's goal).
Use-cases focus on the users
From the point of view of your users, the expected functionality is independent of the from the front-endend. According to your comment, today:
the web frontend is targeting the actor admin with a use case: create a product. On the other side, the tablet front end is targeting the user to buy a product but is not made for the admin.
But tomorrow, your admins might want to use a PC, or a smartphone for the urgent tasks. And maybe some normal users would expect a voice interface rather than a tablet. The use-cases shall help us to focus on theses needs and not the way we are going to address them.
So, in principle, you should model your use-case independently of the front-end. You should not either show the split between front-end and back-end.
How to decompose the system
Use-cases are not meant to do functional nor structural decomposition. This kind of distinction is best performed in component diagrams that decompose your system into components and in deployment diagrams that map the components to the servers and devices.
If you have already a component decomposition in mind, and your component are independent, you could think of modelling the use-cases of a sub-system or a component. This is valid, since UML specs tell us:
A subject of a UseCase could be a system or any other element that may have behavior, such as a Component or Class. Each UseCase specifies a unit of useful functionality that the subject provides to its users
You can even model use-cases for a component, the actors being then the external actors and the other
But would this be helpful? You could have a use-case diagram for the admin application, with admin actors, and a system actor fo the back-end. But I'd not advise to go into that direction unless the app is a rich app with its own added value. If the app is just a front-end you'd just end-up with very redundant use-case diagrams (i.e. front-end UC and back-end UC would show the same use-cases) with a loss of end-to end relation to the real actor (i.e. the back-end UC would be associated with system actors corresponding to the front-end app, but you'd loose the direct link to the real actors).
In the end you might lose the main strength of UC, the focus on users and their goals. In exchange you'd have the burden to keep all the redundant models in sync but I don't quite see the advantage here. If you want to have more arguments about each alternative, you may also have a look here.
No, that's not good. Use cases are meant to show the added value a system under consideration delivers to actors of it. You are looking at implementation details. That is how the interface would look like. But for the added value this is completely irrelevant. You can create different implementations for the use cases so your collaborations will show either the one or the other front end. That will be part of the class design controlled by a requirement User may interact with frontend A and B.

How to improve my software analysis and UML skills [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am working on an open-source project which shows how to develop software iteratively using test-driven development and some ideas from domain-driven design. I know what I would do, however my formal skills (especially regarding UML) are a little bit rusty.
Below I am going to post my first steps with the diagrams and the explanations I would give to my readers.
I have the following questions:
The last step ends with the question But what will stich together these components?. How to show the reader the way in UML terms, while not skipping anything in the train of thought? What I plan to do is to let each component provide an Environment class. For the purpose of testing, a TestingEnvironment will gather all those environments and inject the right callbacks into the World. But which types of UML diagrams to use for showing my train of thought, and in which order? My problem is, somehow, that I know what I want to do, but I can't rationalize it to myself why I want to do it that way - I guess it has gotten a part of me to the point I don't make such decisions consciously any more.
What mistakes have I done so far, how to fix them, and most importantly: WHY?
Step 1
(0001_user_commands_use_cases.pdf)
(0002_user_commands_use_cases.pdf)
User Use Cases - Analysis
We are starting with an use case diagram (0001_user_commands_use_cases.pdf) as
part of the preliminary analysis stage. This diagram should only help us
understand what our client wants. These use cases may change over time, but
never the less, they help us understand the system we are going to develop.
Please follow the arrows while reading the following explanations.
The role the user plays when interacting first with our system will be Guest.
The Guest sends to the system some registration data, which we process.
In the diagram, we are describing what happens from a logistic point of view,
from the perspective of the client for which we write the application. We are
not referring yet to classes or objects, or the concrete workflow, which may
end up being quite different.
We are also not dealing with errors, because that would only add more
background noise to the idea - and because error handling does not add business
value to the system. Of course, a system has to be robust to errors, but keep
in mind that we're now just making the analysis - not the design of the system.
Logistically speaking, after the Guest has sent us the registration data, there
is a Registered User. A registered user can send us the login data, so that he
becomes an Authenticated User.
Following the diagram, we can see how only an Authenticated User can send to us
a request to log out of the system, thus becoming a Deauthenticated User.
Why a Deauthenticated User, and not a Guest back again? Basically, it comes
down to us not being able to foresee the future. We really have no idea how the
client will want us to extend the system - nor does he himself! Beside that,
the two roles, a Guest which we know nothing about, and a user which has just
deauthenticated, which we do know something about, are really different things.
Of course it may be that the Deauthenticated User will exist in our application
only for a very short period of time, or it may be that it's created for the
sole purpose of being destroyed back again, without being looked at by any
other subsystem of our ERP - but still I cannot stress it enough: logistically,
the role of a Deauthenticated User stands on its own.
The second diagram (0002_user_commands_use_cases.pdf) contains all the
information of the first diagram, with some added items. If you follow the
green arrows, you will see that the process is the same.
In the first diagram we notice how all three things done by the ERP system are
some kind of generalizations of a process. We have introduced this new generic
process in the second diagram as "Process Data".
Another element we have added in the second diagram is a generalization of the
three "Sending Data" elements. We are not sure how this will materialize in the
next stage (designing the system), but it looks like there's a generalization
there which may, in the end, make the system easier to maintain and extend.
We always seek new generalizations and abstractions because they have this nice
property of making the code maintainable and extendable.
Conclusion
----------
In our design, the ERP will do one central thing, "Process Data", data which
will come in in a standardized way, represented in our second diagram by the
"Send Data" use case.
We don't know how we will design these things yet, until now we have only
thought about the logistics, since we are doing just the analysis.
In the next commit, we are going to look closer at the application domain, in
order to better see the relations between all these notions and to enable us to
come up with a cohesive design.
Step 2
A rough overview of the components in the context of the application domain
Before looking at the diagram, let me first explain the thoughts I had prior to
coming up with this diagram.
We are going to design an ERP. What is this all about, and where lies the
business value in it?
We are supposedly making the product for a company which makes money by sending
products back and forth. This is the core domain of the application.
The basic idea is that a product P is moved from point A to point B, and in
this process, the company makes money.
The application will allow the company to make money by both being good at
organizing the workflow, and by making an existing workflow cheaper.
Let's say a product can be delivered to point C by taking the route A -> B ->
C, or the route A -> D -> C. The ERP must be capable of deciding which one is
better (in terms of money or time), and must manage the workflow it chooses.
So the whole point is supporting the movement of products around. Around what?
Around the world.
For this reason, let's first draw our first component: the World.
In a real project, I would continue by adding a Product component. I've chosen
not to yet, because this project is an educational one in nature, and I wanted
to get across new ideas about the architecture. If I had focused on the
products, I think there would be too much noise for the type of audience this
project is aimed at, a noise which would make the process of creating the
architecture and the architecture itself harder to understand.
We will introduce a Product component later, when the reader will feel at ease
with the architecture which, at that point, he will feel familiar with.
Instead of focusing on Products, we are going to focus on Users. This is,
incidentally, also the subject of the use cases we have drawn in the previous
commit. I think that any reader can relate to the concept of User.
So let's draw that component, the User.
Architecturally speaking, it's not that much of a difference between an User
and a Product. Instead of having Products moving around, we will have (for
now), users who live in the World and take different roles while interacting
with our system.
In the previous commit, we have concluded that there would be a standard way of
passing in data from the User to the system.
In terms of DDD (Domain-Driven Design), the data that gets into the system is
packed up as a Command. Since it looks like a good name, let's make a port of
the World component called Command Hub which will be used to receive and
process Commands from the outside.
Conceptually, the Command Hub will provide a Command Interface which any other
component can implement in order to send commands to the Hub, if it needs to.
We also want to make the components decoupled and thus reusable in different
types of applications, or to be able to combine them. This is achieved by
making an event-driven architecture.
For this reason, let's give the World component an Event Hub, which will
provide an Event interface.
But what will stich together these components?
This question is so pressing, because it's so central to our architecture, that
we will have to further investigate it.
This is not an asnwer, just a comment that would not fit into the comment box
(1) if you want to "teach your readers" something you can't do yourself, it is strange approach. Show your readers the way which works for you. Show the way "your train of thoughs runs", show the the mental images you saw in your mind, paper/pencil/photo in whatever visualization language you use
(2) you're skipping the uml-diagrams: UML 2.5 Behavior Diagrams as not useful? Even the uml-diagrams.org: UML Interaction Overview Diagrams not useful?
(3) this question looks like too broad(long) perhaps opinion-based and perhaps off-topic much more suitable for https://softwareengineering.stackexchange.com/help/on-topic
(4) for the recommended modeling workflow look at
(4.1) Cangnus's sequence diagramming comment in Stack Overflow: sequence diagram for books exchange
(4.2) BobRodes's use case scenario comment in Stack Overflow: Formal language for UML sequence diagrams
(4.3) Scott W. Ambler's Agile Modeling: Where Do I Start? for what when how and why Agile Modeling Best Practices
to name just a few
In conclusion of this my long comment, I don't see any mistakes you did. If this is description of how Test-driven Development and Domain-driven design works for you so well that you even use it subconsciously then it is just fine and ok. Being a good teach is not an easy task, good luck

Modelling a domain model [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have a scenario which involves a vending machine and then asks us to create to "model the problem domain". I've covered modelling very loosely and was hoping someone would clear this up.
From research it looks like a problem domain is just a domain model which in turn is pretty much a UML Class Diagram.
The examples I've seen look they're almost database schemas with a customer entity, order entity etc etc.
I'm just not sure what the differences are exactly.
So I just wondered if I was on the right track and would anyone mind elaborating on this or perhaps pointing me towards a concise definition. Thanks.
The "problem domain" is just the stuff you're interested in. In your case, it's all the stuff a vending machine does, and who interacts with it.
It boils down to a collection of use cases, which can be diagrammed in a use case diagram. What does the vending machine do? It takes coins from a buyer (the actor), gives change (maybe...so make sure you understand "extension points"), spits out stuff (always, because we aren't in the real world), and so on. Then maybe you can get creative with a different actor. A maintenance person takes out money, adds change, fills up the machine, runs a diagnostic stack, whatever. Each one of these is a use case. Put them together into a use case diagram.
If you want to go into detail about what each use case does, then use an activity diagram. One for each use case.
Any system (software or not and modeled or not) has structural and behaviour aspects.
The structural aspects are non-time bound aspects of your system, such as which classes your system is made up of, their associations and dependencies, how they are divided into subsystems, etc. Most of these elements are often referred to as classifiers.
The behaviour aspects shows how these structural aspects collaborates together over time to achieve the goals of the system, such as methods, state machines, workflows, use case realisations, etc.
The structural and behaviour aspects are what you specify when you are writing your code or creating a model.
Objects, are by definition instances of classes. This means that objects are the "things" that actually exists when the system executes. Hence, you do not program an object; you program a class, which when executed, is instantiated into one or several objects.
However, in many modelling languages (but not common in programming languages), you can also model specifications of scenarios, which show specifications of objects and how they interact, for example in UML you may create an object diagram, showing one example of how the system of objects (i.e., instantiated classes) might be structured and collaborate during execution.
Now, a system always strives to a achieve one or several goals for it's surrounding. The surrounding is made up of persons and/or another systems (actors) interacting with the system. This "surrounding" or "background", on which the system is situated in and makes sense in, is often called the "domain".
These "actors" have a "problem" they would like that the system helps them to solve. When this problem is modelled, one calls that model the "problem domain model" for the system. It states the logical structural and behaviour aspects of the problem domain, without stating how it is going to be implemented in a specific implementation of a system. I.e., it is not referring to implementation aspects, like Java, SQL, primary keys, transactions, reflection, angular, etc; it is instead focusing on the core structures of the domain, like Orders, Parties, Contracts, Products, etc.
The problem domain model is one of the most important "contracts" between the system developers and the persons paying for the system or being owners and users of the system. It makes it possible for you all to understand the problem to be solved in the same way and are makes sure that you all are using the same concepts to reason about it. Since it, by definition, is not a technical artefact, you should describe it using as simple notation (but still stringent and crisp clear) as possible so that also non-software professionals could understand and agree on it. Class diagrams (stripped from all technical details) and use case diagrams are two notation techniques available. But also object diagrams and activity diagrams could come in handy.
If you are interested in this, I deliver a course in advanced concept domain modeling on Udemy. Here is link and 90%-off code: https://www.udemy.com/get-your-concepts-straight/?couponCode=CONCEPTS29
Regards
Per

UML Use Case Diagram: Access included or extending Use Cases [duplicate]

This question already has an answer here:
Have I to use the same actors for those extending or included use cases? [closed]
(1 answer)
Closed 6 years ago.
I am currently refreshing/altering my knowledge in software development because I will work in this area soon. We have learned a lot about UML diagrams and coding at University, but I have never brought it all together in a real Project. Therefore, I started to create a test web-app in Grails, and I wanted to begin with a requirements analysis and use cases too keep it close to reality.
My web-app should allow users to share recipes, find recipes and review recipes by other users. Every recipe has many ingredients, which are not just strings but rather entities so that calories, fat, protein and carbs can be used to automatically calculate nutrition facts of a certain recipe.
An ingredient can be added to the database by either a consumer or nutrition expert. If it is created by a consumer, it is only a "prospective" ingredient, meaning that it has to be verified by an administrator to become a "proper" ingredient -- otherwise it is marked, e.g. red text color.
This is my current use case diagram:
http://ubuntuone.com/0zDw9kEbj1BwtXjnCtxdwC
My question here is:
Can extending or included use cases be accessed independently? If I do it as in the screenshot, can AddProspectiveIngredient be used without going through the CreateRecipe use case? Same question for included use cases.
EDIT: I don't think this is a duplicate of this question. In the linked question (1), I ask if I have to use the same actor for extending and included use cases as in the extended or including use case. In this answer (2), however, I merely ask about reuse between use cases.
In (1) it is all about the actor, and I am very satsified with this answer, as I now understand that the primary actor of an extending use case will inevitably be a subclass of the primary actor of the extended use case.
(2) addresses reusability of extending and included use cases, but is not necessarily connected to actors. It is about reusing them in other use cases. So if I have two use case CreateRecipe (a) and AddIngredientToDatabase (b), where (b) extends (a), can I also extend a third use case with (b)? Here I also received my answer, that they can and should be reused.
Maybe the questions seem similar because I created them on the same day with the same example and the answers both mention actors, which make them seem as duplicates. As they are both answered and I am satisfied with both answers, why close the questions as "too broad" or "duplicates"? If it was answered succesfully with different answers, how can it be too broad or a duplicate?
I am also happy to rephrase them slightly to keep them open, if I am told what the core issues. More answers and comments on the topics are still interesting to me.
Can extending or included use cases be accessed independently?
They rather should be. It is a good and correct style. Use case is some activity conducted between one or more actors and system. You should try not to show here some inner operations, that are not connected to users. Nothing invisible to users can be shown here. USER cases, remember?
So, no inner structure here.
You can collect some cases in groups - subsystems. But it is not inner structure, they are not IT systems, they are simply common themes of activities, obvious for users. Such subsystems should get later at least common UI style.
As for logic that could be used by users, it can be shown on other diagrams. Many diagrams can exist on this level - State machines, Activities, Timing. But don't try to show processes on the Use case diagram, too.
So, I don't know how well have you interviewed the client, but you use case diagram looks almost correct. Only the AddProspectiveIngredient Use Case should get its user or more.

I have many processes in my usecase , is this normal? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm working now on a big system that consists of many subsystems , each subsystem depends on the other. I wrote a usecase for this system , but I note that I have many processes in my usecase ( more than 40 processes ! ) . it looks like this :
Group subsystem:
add Group.
remove Group.
join to Group.
upload file.
create poll.
remove file.
remove poll.
write post/topic
close post.
edit post.
....
Messages Centers
send message
view inbox
read message.
and so on ..
this is a screenshot, just to know that is a large usecase :)
http://farm2.static.flickr.com/1308/4691773979_4c5a30f26c_b.jpg
each user interacts with these processes .
How can I reduce the number of these processes?
Is it possible to divide the usecase processes into many pages?
I'm not sure of what you meant by dividing it into many pages but you can certainly divide it into multiple use cases, or multiple subsystems... but is it worth it?
Use cases, as far as I know(which isn't much), are used to show clearly what kind of interactions an user can make with a system, or even a system with another system. It is possible to produce a comprehensive use case with only one system having all these options, but it is also possible to do it while separating everything into smaller subsystems.
I would suggest you use whatever you're more comfortable with, as long as whoever need to see that diagram can have a clear idea of how each actors interacts together.
Furthermore, if you're working on uses cases, chances are you've made a package diagram/list before. If you did, you could simply do one use case for each package.
Your terminology isn't quite right.
From the picture, that's not ONE use case.
That's dozens of use cases. Each oval is a separate use case. Each box is a separate system. You're showing 7 systems with 32 use cases.
Read this: http://www.agilemodeling.com/artifacts/useCaseDiagram.htm
I don't know what you think a "process" is. Guessing from your picture, each thing you're calling a "process" is a use case. An actor interacts with the system to create something of value.
Since you've got the terminology wrong, it's difficult to say if it's "normal". It is quite common, however, to get the terminology wrong.
It is possible to divide in several pages. You can divide the diagram according to the actors. So you can have one actor and all use cases associated that that actor in one page.
Try to analyze if its necessary to include all the use cases in the diagram, but of course this depends for what and who are you ding this diagram.
You should group your use case. For example create a use case "Manage Group" which would include the 3 use cases:
add Group.
remove Group.
join to Group.
You can then choose the granularity of your view to show details or not.
See other examples here:
http://askuml.com/files/2010/06/yuml-use-case-diagram03.png
http://askuml.com/files/2010/06/yuml-use-case-diagram02.png
taken from http://askuml.com/blog/yuml-use-case/

Resources