I am working on a project where I'll first create a framework for the iOS platform(pod) and after that I will implement this framework in an actual iOS application to show the use of it. The framework is supposed to gather data about the user's face from the camera and the heart rate from an Apple watch.
Now when it comes to modeling this in a use case diagram I am unsure. Should I show both the user and the framework as actors in one use case diagram? And then show that the use case that provides the data about the user is the framework's job?
No, the User is an Actor and the framework is an implementation detail that you could model in several ways depending on what you want to show. For example, it could be represented in terms of the module structures (libraries), class structures within these, component models and/or deployment models, state charts, sequence charts and so on. Who is your audience and what do you want to covey? Are you using UML to help you through the design process, i.e. using formal languages to get you to think about the right things and answer the right questions? Answering these will help direct you to an approach.
UML use case diagrams are made according to the activities of active assets.
Related
I have this simple diagram, it doesn't follow any type of UML diagram. Its goal is to show all the parts of our solution, and how they're related.
In the image: the web scraper scraps the data in some websites and stores it in the database. The web application receives filter options and implement it using a Rest API that returns some data to be exported in xlsx and csv. The API uses the database populated by the web scraper.
I need to make a new diagram with the highlighted process above, using UML. I had a suggestion to use a package diagram, so I made this version:
Edit: In the image: Fonts -> Web Scraper -> Database -> Api(Filters(type of filters)) -> Front end (results, search options) -> User
Is it the right way of making a package diagram? I couldn't find a similar example or specific rules for this case.
Are packages the right modeling tool for your needs?
Packages are namespaces and aim to structure a model. A package diagram therefore does in not represent a process with data flows (dynamic behavior). The relations between packages are namespace relations such as «imports» and «merges» and dependencies.
Your package diagram certainly shows some valid decomposition of your design with nested packages. But you would normally not represent users (usario), or flows of data (dados) coming from a database (Banco de dados).
What are the better alternatives in UML?
Your initial diagram shows in one picture, using some flowcharting symbols, very different things:
conceptual classes of objects such as fonts, filters, or files
components such as web scraper, the database, front-end, back-end,
flows of objects like the webscraper that feeds the database that is queried by the backend, or interactions between freont-end suppliying filters and back-end that provides data.
If you want to represent this in UML you need to clarify the focus, because UML requires some precision since it separates structure and behavior. The answer will depend on what you want to show:
the flow of processes and data? Use an activity diagram (behavior). This is perfect to show the flow from the source to the end-result, but not so easily the parts of the system that are involved.
the relationship between components ? Use a component diagram (structure). This is perfect to identify the components, how these are nested, and how their interfaces are connected. But it does not show the order in which all this happens.
the interaction between components ? Use communication or sequence diagrams (behavior). Here you see what the components exchange in what order, but not so well how the components are structured.
Spontaneously, I'd go for components, since I have the impression that this dominates your original diagram. But in the end, you may use different diagrams for showing the different aspects.
Other alternatives
If you're looking for a single diagram to combine the different thoughts of your original diagram, alternatively to UML, you could consider C4 model diagrams.
It's less precise than UML, but very convenient for communicating the big picture of a system architecture. The C4 context diagram and the C4 container diagram in paticula allow to show the system's main components, and some high-level relations (including data flows) between them.
The good news is that C4 relies on UML for the the more detailed design of the identified components.
Could you please let me know whether flow chart can be consider for use case modelling? As far as I know it just represents a flow of events and do not have any actors, so cannot be considered for modelling.
Can some some experts confirm this?
Flow charts are the ancestors of activity diagrams and as such very rudimentary. You can use flow charts along with use case modeling, but it is not a good idea. First you will limit yourself in the language (think of a native speaker vs. a foreigner that knows only a little vocabulary). Second is that activity diagrams are matured to a standard within UML. So you can expect more people to be able to read and understand them correctly. And last: activity diagrams are the basis for BPMN which is going to be the next step after use cases (it brings a whole set of new standardized language elements which allows expression of what is in and behind a use case).
And yes, your basic assumption is correct: no relation to actors. So you'd need to find ways to express that outside the flow chart.
See also Wikipedia.
Firstly, I'm still quite new to UML; but, highly interested and am attempting to learn as much about it as I can.
With that said, I’m in a situation where I’m directed to assemble a ‘Context Diagram’. I feel as though I understand the concept of what a context diagram is and how to create one, so I think I’m ok there. Basically it is identifying the system and the components or actors it will interact with. It applies the focus on the system, and not the actors. Kind of like a Use case diagram, but not focusing on the actors. If I’m wrong, please tell me.
I read somewhere that Context Diagrams are not actually part of UML. I also read, somewhere, that, if you use a Context Diagram, it falls into the Component side of things. When I read about Domain models, it seems like it should be there.
For my current situation, I know a simple answer is to simply create the diagram and move on, as that is all that is required. But, for my interest to better understand and leverage UML, I know there is a right way and a wrong way. If I were in a case of a bigger project, what would be the right way?
Now here is where my question begins. I’m using Enterprise Architect, create my project, and start to create a model. Does it belong in a Domain Model or Component Model? What is the difference between these two? Or even more. As it is an aide to help identify requirements, should it go there? Or does is just simply depend on what and how I want to convey it?
The Domain Model is where you standardize the vocabulary that everyone on the project will use to communicate in a consistent manner. The development team are experts at software development, but they may not have any experience in the domain (e.g. banking, air traffic control, healthcare) in which they are being asked to work. So you get domain experts and modelling experts together to build a model that describes the domain, answering important questions like "how are account fees calculated?" and "how does a pilot know what route to follow?" and then this model is then passed to the development team to provide them with the important domain knowledge that they will need. I would use UML class diagrams to create a domain model.
A Context Diagram shows the system being modeled in relationship to external systems. It could show data flowing in from and out to external systems, modeled by a data flow diagram (not part of UML). It could show behavioral interactions between the system and external "actors", modeled by a UML use case diagram. It could show the system's physical connections to other systems, modeled by a SysML block diagram. Whichever you choose, it will be on page 1 of your design document, so choose wisely!
You (can) create context diagram by making any element composite. Then drag the element itself onto that diagram as link (not instance!) and highlight it by making the border a bit thicker. Finally insert related elements from the context menu (differs from EA version to version). Layout the diagram and now you have your element in the context.
A domain model is usually a class diagram showing the (business) domain on a higher abstraction level.
As you have said, Context Diagrams per se are not part of the UML spec. There are plenty of ways to do a context diagram, but the UML way is to use a Use Case diagram, with or without supporting narratives and scenarios. Start with this, which is a broad overview of different types of Context Diagrams. Then, investigate use case diagrams, use case narratives, and activity diagrams. If you need to go into more detail than a use case narrative can easily do, get into use case scenarios and sequence diagrams. Here is a pretty good use case narrative template (feel free to leave out sections such as "scope and level" if they are more than you need, and consider adding information about what triggers the use case and where you go when you finish it--these two are required for scenarios if you go that far).
Keep in mind that use case narratives and use case scenarios are often confused. (Some people will say that I am the confused one; I will invite you to judge the matter for yourself.) A narrative is an explanation of an entire (single) use case, and may be supported with an activity diagram. A scenario is an explanation of a single path through a single use case, and may be supported with a sequence diagram.
For example, a use case will generally have a basic flow of events, along with a number of alternate flows. The narrative describes the entire process. The basic flow and each alternate flow would each be a separate use case scenario.
I suspect that it's unlikely that you will have to get down to the level of use case scenarios. You will probably want to put a use case diagram together, and possibly prepare narratives and activity diagrams for each of the use cases in the diagram.
I would like to know:
how to convert users stories into sequence diagrams?
and what is the most easy diagram to understand (for customer)?
Traditionally, a use case is converted into sequence diagrams (through a "use case realization" collaboration for traceability). User stories are different from use cases in that the latter provide a set of distinct steps to take whereas the former concentrate on a need and reason.
If you were to to take a use case, each of the steps in the use case would be represented by messages in the sequence diagram. The use case actor (the "user" in the user story) would be the initiating timeline and a second timeline would be the "system". You could then iterate on that sequence diagram to extract various system components (thereby building a domain model for your application).
Does that make sense to you?
how to convert users stories into sequence diagrams?
There is no straightforward easy way. There is not enough information as user story is basically one or few sentences of text. Converting use cases to sequence diagrams is easier and can be partially automated
what is the most easy diagram to understand (for customer)?
it depends on who is the customer. In general, overview diagrams, e.g. BPMN style should be easy to read. See my answer to the question "UML diagram for dependency between systems" for some options and useful links
suggested readings
Enterprise Architect video - how to convert use case into a diagram -http://www.sparxsystems.com/resources/demos/use-case-analysis/structured-use-case-scenarios.htm
Enterprise Architect - various ways how to capture requirements and communicate them to stakeholders - http://www.sparxsystems.com/products/ea/requirements.html
Mike Cohn's page (defined the term "user story") about user stories - http://www.mountaingoatsoftware.com/agile/user-stories
Alistair Cockburn's page (defined the term "use case") about use cases - http://alistair.cockburn.us/Use+Cases
Some examples of tools for creation of sequence diagrams: https://www.websequencediagrams.com/, http://creately.com/diagram-type/uml-sequence-diagrams, you can Google out many more examples both free and payed both online and offline
In my opinion, what works best with the customers are not use cases. They are too abstract and complicated even for the most of developers. And when they are finally approved, you're never sure whether the customers actually understood them correctly.
I suggest the mix of UML activity diagrams and user interface prototypes (non UML) as far the best tool to work on this level of analysis with non technical business people.
Activities model their business in an intuitive, easy to understand and clear way.
UI Prototypes as well, so they can see how they business maps to screens.
Behind the curtains, I like to support activities with a formal and accurate domain class model, invisible to customers of course, but open to developers and making a nice technical backbone of the future system.
User stories fit perfectly in this modelling set, you can even make them less formal and more high-level, as the rest will fill the information gap. Sequences can now be build using domain objects, connecting 2 views - customers' and developers'.
I avoid use cases strongly, whenever possible (although I personally like them).
I am new to UML designing and read few articles on this. bit confused where to start..
Do i need to prepare all of the UML diagrams for a web application or is some diagrams are only essential for an application.
Thanks,
Start from Use Case - define, who will use your application(actors) and what they will do with it(use cases). Also, join close use cases into subsystems.
Component diagram - what main parts the system has and what info they will send to each other and if some part belongs to another
Go on with State machine - define what states will have your components and on what reasons can they change they states to other ones.
Deployment diagram will define on what PCs will these components live and about the connections/protocols/interfaces between them
Plan your user interfaces - now only the set of pages and frames and navigation between them and commands on them. Do not solve placing and colors yet
Class diagrams for every component
If for for some of your classes some instances are specifically important, use object diagram.
Draw the look of the UI
Code.
UML is there to help you. Pick only what you need. You'll hardly ever need all diagram types. Plus, it is convenient for the reader if he needs to know only a predefined UML subset to understand your draft.