Nikos Maravitsas

About Nikos Maravitsas

Nikos has graduated from the Department of Informatics and Telecommunications of The National and Kapodistrian University of Athens. Currently, his main interests are system’s security, parallel systems, artificial intelligence, operating systems, system programming, telecommunications, web applications, human – machine interaction and mobile development.

Eclipse class diagram example

In this tutorial we are going to see how you can generate UML class diagrams from your source code, using Eclipse. Class diagrams are an extremely helpful tool, visualizing the structure of the code of your project. It is a very good companion for your documentation.

There are many Eclipse plugins that do class diagrams and most of them are quite good. In this example we are going to use the most classic one, class ObjectAid UML Explorer.

 
 
 

1. ObjectAid UML Explorer Eclipse plugin installation

In this tutorial we are going to use Eclipse Kepler 4.3. We are going to show you how to install ObjectAid UML Explorer in Eclipse, and a glimpse of how you can use it.

1. In order to install ObjectAid UML Explorer in Eclipse, go to Help -> Install New Software…

Figure 1: Install New Software

Figure 1 : Install New Software

2. Paste this URL : http://www.objectaid.net/update in the Work with text field.

Figure 2 : Add URL

Figure 2 : Add URL

3. Click Add and put ObjectAid in the Name field and click OK.

Figure 3 : Add Resource

Figure 3 : Add Resource

4. Select all the plugins you want to install and click Next.

Figure 4 : Select plugins

Figure 4 : Select plugins

5. You will see an overview of your installation.

Figure 6 : Installation Overview

Figure 5 : Installation Overview

6. Accept the Licence Agreement and click Finish.

Figure 5 : Accept the Licence Aggreement

Figure 6 : Accept the Licence Agreement

7. Give it some time to install the new Software.

Figure 7 : installing...

Figure 7 : installing…

It is likely the a Warning will pop up during installation. Click OK to ignore it.

Figure 8 : Ingore Warning

Figure 8 : Ingore Warning

8. When the installation finishes, you will be prompt to restart your Eclipse IDE. Click Yes.

Figure 9 : Restart Eclipse IDE

Figure 9 : Restart Eclipse IDE

2. Create a Simple class Diagram

When your Eclipse IDE restarts, this is how you can create a Class diagram for one of your projects.

1. On the Project Explorer, Right Click on the Project’s name -> New -> Other. On the pop up box, start typing Class Diagram in the Wizards text field. Click on the Class Diagram and then click Next.

Figure 10 : Add new Class Diagram

Figure 10 : Add new Class Diagram

2. Type in a name for the diagram file, and select the several details and options.

Figure 11 : Diagram Name and Options

Figure 11 : Diagram Name and Options

3. After that the blanc page of the Class Diagram editor will open. From then you can Drag and Drop a class from Project Explorer in order to create it’s UML node in the Diagram. Here is a simple Class Diagram that I’ve constructed.

Figure 12 : A simple Class Diagram

Figure 12 : A simple Class Diagram

Download the Eclipse Project

This was an example on how to create Class Diagrams with Eclipse.

Download
You can download the full source code of this example here : ClassDiagramExample.zip

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.
Examples Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Examples Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Examples Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close