Steps to be followed for creating UML diagrams? - uml

What are the steps to be followed when we start UML diagrams for new features or requirements?
I need the entire steps like
Identify the actor,
Identify the use cases,
like this etc....

What you need is some sort of methodology.UML doesn't come with any, because it is ment to be methodology independent. However, the authors of UML have created some methodologies, which heavily use UML. One of the methodologies, which is free, is Unified Process or UP for short. Try to look at that, there are plenty of books, which discuss UML and UP at the same time.

Create a simple model of the existing system, and a detailed model of the area you plan on working in. There are a number of different types of diagrams (activity, sequence, class, etc), you should use the ones most appropriate for the complexity of your system and its interactions with other components, systems, and people.

This is a very board expression. In general, I would start with Use Case diagrams and go from there. As Gabriel pointed out, there are entire books written on this and there is no one right answer. My personal favorites for Use Cases are:
Advanced Use Case Modelling
and
Writing Effective Use Cases

Take a look at Craig Larman's book "Applying UML and Patterns". That describes very accessibly how to use UML to tackle a problem (Use Cases, Class Diagrams, ...).

Related

Sequence Diagram: What is the difference?

I'm new to using Sequence Diagrams, and I'm trying to find references but too many things make me ambiguous. There are a number of questions that I will ask about this problem.
From this references Ref1 and Ref2 I see a difference between Image1 1 and Image2 . For image1 he use MVC method, and for image2 he just pass it to database, and last i found this image on google he using boundary, but on PowerDesigner i dont see boundary icons
.
Can you explain to me the difference between the three images?
Which should I use to create a login sequence diagram? In my case I will make "Web-based Monthly Report Archiving"
Can you give me a reliable reference for making Sequence Diagrams?
I always recommend reading some book explaining how to model system using UML. It makes things easier and you can find some on-line.
Ad1.
Sequence diagram is a method of showing the interaction in a specific sequence but it does not assume anything about methodologies or standards used during modelling. MVC is a standard unrelated to UML creating some best practices about how to design systems. Whether you use it or not is up to you (unless you're constrained by e.g. your company).
As already mentioned in a comment by bruno since MVC is not part of UML standard it does not have to be implemented in UML compliant tools. Yet since it's quite popular you may find it in many tools anyway.
Ad2.
It's up to you and your design decisions.
Ad3.
This page in general is not about suggesting sources for general things. As already mentioned above I would recommend reading some good book about modelling in general. My standard recommendations are Howard Podesva's "UML for the IT business analyst" and Craig Larman's "Applying UML and patterns". A direct reference about UML may be found on this excellent page but it will not tell you how to model or design, only how to depict your model properly on UML diagrams.

Is use case narrative part of the UML?

Is use case narrative part of the UML?
A textual description of the business event and how the user will interact with the system to accomplish the task.
First of all, UML means Unified Modelling Language. It is a language which helps in designing and modelling software systems. So use case is not a part of UML. UML is a tool that helps to represent Use Cases (Among other things). And Use Case Modelling is an approach in requirement engineering for understanding and describing the functional requirements of a System.
It can be both narrative and graphical. Textual representation part is called use case specification while the graphical representation part is called Use case diagram.
So what is a use case? A use case is a summary of scenarios for a single task or a goal like "pay bill" in the above image. And a Use case model typically consists of several use cases. It helps to provide a clear picture about the external actors (both users and external systems),the functional requirements of the system and the relationships among them which in turn leads to a better design.
I'm going to assume that you mean "use case narrative." That given, the short answer to your question is "no."
A "use case narrative" is a document that describes the entire behavior of a use case. The UML doesn't define documentation methodologies specifically, so this isn't part of the UML specification.
The UML community has yet to build any sort of consensus on a term for this document (and, indeed, exactly what it ought to contain). Nipun Sampath, in his answer, calls it a "use case specification," for example, and muszeo calls it a "textual description," which, of course, it is.
The behavior of a use case would be modeled in UML as an activity diagram. So, an activity diagram is a diagram of a use case narrative.
For more information on use case narratives, see this post.
I believe you mean Use Case, rather than User Case. The description you give (textual description of steps to accomplish a business task using a system) is broadly what Use Cases are about.
To be clear, a Use Case is a kind of functional requirement; namely a description of a process that a person and/or system (role(s)) performs with information to accomplish an objective that has business value. With Use Cases this specification generally starts with a model ('blobs on a page') which illustrates the process, system and actor (role) context, with a textual description and/or supporting models (e.g. Activity Diagrams) to express the steps of the process. There are other ways to express functional requirements -- User Stories and BPMN process charts are two other examples that achieve the same thing but in different ways. You may be confusing Use Cases and User Stories, perhaps.

What is the difference between UML Domain Model and Context Diagram

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.

Need of UML Diagram

Please help me know as to when it(uml) is necessary. I was told that generally UML are drawn for web based application developement, for desktop based, DFDs and ERDs are used. My university requires all the diagram(uml,dfd,er). please let me know if my information is correct? Thank you
UML Diagram are imporant because it help the person to understand the relationship and dependency between different class present in the code(Class Diagram).
Flow of the program(Sequence Diagram , Activity Diagram).
Help to improve the program architecture etc.
And read about different type of UML diagram you will get more information.
Your needs in using UML depends on your position and your (self)education.
Some companies use UML. So, you would need it to get a job in them. Just now your university requires UML diagrams, so there IS a need in them, isn't it?
If you know UML a bit, you could understand the thoughts of your colleague who wants to share them with you this way.
If you understand the language of a UML diagram, you can use it for improvement of your thinking on the problem. So, you can think into the problem deeper and faster than without a tool. You should be really well acquainted with the tool though, for when inventing something new, you need to think on the domain problem, not on the language problems. But you don't need to know all the rules for this level of use yet.
If you know UML so that you can draw diagrams up to their strict rules, you have two more uses of it.
Translating your knowledge of the problem from one level of abstraction to another and modelling these levels up to the strict rules, you are filtering many misunderstandings in the already accepted model and can practically debug the model before coding. It can save much time and money.
While you are making the diagrams according to strict rules, you can collaborate on the model with your colleagues. It is always better if you can express your ideas more precisely.
As for technology limitations, you can use UML very widely, even out of the IT needs. As for IT, only GUI creation is supported badly. And anonymous classes are almost not supported in class diagrams at all (in behaviour diagrams they work OK).
DFD (datya flow diagram) and ERD (entity relationship diagram) diagram are tools for structural analysis and design, this is way to build structural application (data bases and functions). UML support quite different paradigm: object paradigm - we build application as collaborating objects. DFD and ER (ERD) diagram is not part of UML. We can use ER diagram for data base modeling and join to UML domain model by the ORM (object-relational mapping, implemented e.g. by Hibernate).

How to use BPMN and use case and other diagrams together

BPMN (Business Process Modeling Notations) is used for modeling business process by visualization, thus making intangible ideas become physically concrete through the expression of BPMN diagrams. The question is, how do I organize the BPMN with the UML.
Initially, I thought of two ways to organize use cases and business process diagram:
1 to one/many: By mapping each step (step here means each node in the BPMN digram) in the business process diagram with one or several use cases. Each use case is mapped with relevant several class diagrams/component diagrams (I prefer this one, since you can encapsulate a set of classes into one component which has input and output), several sequence diagrams (optional). After you have class diagrams/sequence diagrams, code is written/generated based on the model.
Many to one: By mapping several steps into one use case. The subsequence steps are the same.
Many to many: For example, one step in the business process can be mapped with two or more use cases, and the same two or more use cases can be mapped with other steps.
The above methods can be done by the modeling tool, and in my case, I use Enterprise Architect from Sparx System. I discover it recently and I am using its trial, but I will buy it in the future. I can organize many use case diagrams with one step of the BPMN diagram, and can click to view the necessary use cases. However, I don't if it supports many to many cases.
After thinking my own method for organizing BPMN and Use Cases, I searched the Internet, and found two other papers, each suggest the following method:
Turn each use case into each step of BPMN diagrams: To visualize how refined use cases fit into the business process. I like this approach, since the business process with steps can be modeled, and later each step is turned into a use case. One step is one use case. This is the same with my one to one mapping above. Original presentation is here: Visualizing Use Case Sets as BPMN Processes
Each use case is exactly a business process: Each step in the use case is each step of the business process. Original paper is here: Describing Business Processes with Use Cases
It seems to me that there's not standardized way of gluing these artifacts (BPMN and Use Cases and other digrams) together. Maybe it's a management problem and rely more on creative usage rather than follow a formal steps. What are your opinions/experience on the usage of these diagrams in software engineering process?
I know methodology like XP which specifies its own practice in software development process. However, unlike Scrum where it focuses more on management aspects (which means you can still apply the BPMN/UML modeling into your work process), XP specifies software practices and requires you to follow, and eliminate the modeling process like BPMN/UML, and its practices if not apply properly will lead to issues like under documentation, incorporates insufficient software design....
I prefer the model driven way than XP. I guess it's up to the preference of companies and people. One of Agile goal is to "free developers from document works". Methodology like XP seems to easily lead to under documentation. I think to achieve that goal, the solution is to implement the tool to help developer reduce the workload on writing document, not by writing less documents, by gathering information from existing diagrams and automatically generate reports (in RTF, PDF, HTML in the case of Enterprise Architect of Sparx System). Another example is, people often complain about drawing diagrams consume their time. In my opinion, the solution is not to draw diagram, but the using the tool. Modeling tools today support round-trip engineering, where you can synchronize between your code and your diagrams, thus eliminates the extra effort to manually correct the diagrams if the code base changes (specifically, class diagram). What's your opinions/experience on this issue?
Usecase should be goal oriented tasks they are not single steps. The first example is a definite variation of the standard way to utilise usecases. I suggest map each usecase onto a single business process. This Sparx EA example maps usecase onto activities diagrams but does reveal the approach to use.
My 2 cents
My suggestion is to use these tools to understand the business processes. I follow the below
End user point of view: user stories
Business Analyst perspective: use cases (with main and alternate flows) and specification by example
BPMN: Executable business process
When you start looking out for the perfect marriage of all these, you will be lost in details. ;-)
I suggest this approach: https://www.academia.edu/6750935/From_Business_Process_Models_to_Use_Case_Models_A_systematic_approach
Generally speaking, one process maps to more than one use case, only in particular cases the relationship goes one-to-one.

Resources