Introduction: How to Create a UML for Java in Microsoft Visio
At first, creating a UML can look a little intimidating. There are a lot of complicated notation styles, and it can feel like there are no good resources to format a UML that is readable and accurate. However, Microsoft Visio makes creating a UML quick and simple with their templates and easy-to-use interface.
Step 1: Prewriting
Before you begin creating a UML, it is good to either have your code complete or have all of your pseudocode complete. A UML is essentially pseudocode organized into a flowchart, so knowing what your code will include is important. This means methods, fields, and security types for each of your classes. Maybe sketch out a rough idea of what you want your UML to look like when you are finished. Prewriting helps you stay focused and organized when you begin work on the actual UML.
Step 2: Outlining Dependencies
Before you begin putting the small details of your classes into your UML, it is good to outline all of the dependencies of your code. On the left-hand side of Visio there is a tab dedicated to different kinds of dependencies and code structures. Denote inheritance with a hollow arrow like in the example. You can visit https://creately.com/diagram-type/article/simple-guidelines-drawing-uml-class-diagrams for more information on how to format your UML.
Step 3: Filling in Details
In the photo, you can see how this example class is filled in with fields and methods. As you fill it in, make sure to denote your methods and fields with a + for public, a - for private, and a # for protected. Visio automatically creates two separate sections for you to write fields and methods, so you don't have to worry about designing a table to fit everything just right.
Step 4: Finishing Touches
In the Design tab at the top of Visio's interface, there are many different aesthetic and color options that you can use in your UML.
There are all kinds of design choices that you can make to make your UML more readable or more interesting, but you need to keep in mind that utility is the first and most important function of your UML. You want other people to be able to look at your outline and have a basic understanding of what your code does.
Once you have finished changing the look of the UML, congratulations! You're done, and now you can make a UML on your own!
I have included a finished PDF of a UML file that I created in Visio. You can look at it to get some ideas, and maybe understand the process a little more.