I recently looked at "Head first design mode", and in the previous blog I also mentioned this book, this is a very classic, very easy to understand the book, written very well. Because this book is described in Java, so I used the myeclipse wrote a bit of code, has been using Vs,vs to build UML diagram function is very powerful, now found MyEclipse can also build UML diagram, and the function is very powerful, learning design patterns, The combination of Class diagram learning, will be more effective. The following is the process of building UML diagrams in Visual Studio and MyEclipse, where class diagrams are the example, and the other diagrams are built almost like class diagrams. There is a mistake in the blog, I hope you criticize it.
Building UML in Visual Studio
There are two ways to build UML class diagrams in VS
1. Building a UML project
First step: Create a new modeling project
New->project->modeling Projects
You can create a modeling project, and then you can add UML class diagrams.
Right-click the project, add a new item,
This shows the UML diagrams that can be added, including class diagrams, sequence diagrams, use case diagrams, and so on.
After adding the class diagram, we can make a UML class diagram.
The toolbox on the left contains the basic components of the class diagram, and the corresponding components can be drawn in the middle class diagram, such as
VS class Diagram, support reverse engineering, that can be generated by the class diagram code, in the class diagram blank, right-click, select "Generate code", you can generate code
2. Adding a class diagram to a project
VS, you can also add Class diagrams to your project
I still take that little game as an example, game project: Click to download
I also wrote 3 analysis of the game's blog, below is a link to three blog posts, interested friends can see
Policy mode
Factory method Mode
Single-Case mode
Right-click the project, add New item, select Class Diagram
is not a UML modeling project very much like, in this class diagram, you can also add new classes, you can also directly drag the project class, you will automatically generate class diagram in the class diagram, so that the structure of the project will look very clear, the following is the small game of the class diagram, is not very clear
You can also refer to this blog: Singleton mode
Building UML in MyEclipse
Building UML Class diagrams in MyEclipse is similar to vs.
Because in the "Head First design mode" in the decorator mode, so need to build a Java project, and the source code into the book, here to say how to import the existing Files MyEclipse project
The source of the book "Head first design mode" can be downloaded here: Download
Import an existing file into the MyEclipse project
1. First build project: File->new->java Project
Build a project
2. If there is a package in the source file, you need to first set up the package in the project, right-click the project, create a new package
You can see the packages we build in the project, where the packages exist as folders in the resource Manager
3. Import an existing file: Right-click the package->import->file System
Select the source file that you want to import.
Building UML Class diagrams
Right-click the project and create a new UML2 Model
Then we can just drag the class directly into the class diagram, just like in VS, and we can automatically generate the class diagram.
The function is not very powerful, so that after building a class diagram, it is very helpful for learning design patterns.
Building UML diagrams in Visual Studio and MyEclipse