Create a Java Project

 

In this section you will learn how to get started using Eclipse, create a Java Project, a src folder and a package, start modeling inside the EclipseUML Class Diagram and finally add a new stereotype to a java class.

Switch to Java perspective, select the java perspective icon in the main menubar.

 


In the package explorer, right click on the background to open the popup menu > New >Project.




 

In the first page of the New Project list wizard, select Java Project.




 

Edit the Project name (e.g tutorial) and select Create separate source and output folders under the Project layout heading.




 

Note that the tutorial project has been created in the package explorer.




Select src in the Package explorer > New > Package.




Edit the package name (e.g tutorial)



 

 

Select the package named tutorial in the package explorer, right click on the package element > Open UML > Class inheritance explorer. Note that selecting Class inheritance, dependence or association allows us to create a class diagram with the same name as the package.


 

The class diagram appears. We need to create a class and so use the class diagram editor. Select the Create a class icon from the toolbar and drag the icon to the class diagram editor. The class will be created at the place where you drop the icon.


 

Enter the name of the class in the Name field (e.g. Employee) and click on the Finish button.


 

Note that the Employee class has been created in the class diagram editor. We now want to add a specific stereotype (e.g. "MyStereotype") to the class. We left click on Employee inside the class diagram editor and right click to open the popup menu > Properties.


 

Click on the New Stereotype button.

 

We are trying to enter "MyStereotype" in the Stereotype tab, but it is impossible. We can only choose a stereotype inside the drop down list.

How do we create a standard UML 2 stereotype ? (see the next section to find out)



 

The first step is finished, we have successfully created a project, folder and package. However, we were not able to add a custom stereotype as was possible in UML 1.X. It is important to understand that UML2 doesn't allow us to create stereotypes without connection to the UML2 metamodel. The next step is to create a UML2 profile that contains the new stereotypes.

 




 
Last update Mon Feb 07 14:56:23 CEST 2005 Valid XHTML 1.0 Valid CSS All text, graphics © 2002-2005 by Omondo