UML and forward-reverse engineering
| Prev | Next |
Main steps
Theory
- If necessary, review presentation: UML
Set up tools
- If necessary, install some UML forward-reverse engineering tool e.g.:
UML Lab Modeling IDE for Eclipse
orUML class diagrams for IntelliJ IDEA
or- GreenUML plugin for Eclipse
- Investigate how to use them for different diagrams and Class diagrams particularly
Complete exercise
- Investigate jtm.extra04 package
- Create a class diagram for Animal, Mammal, Bird, Dog, Hawk classes.
- Draw UML diagram in jtm.extra04 package (excluding ..Test.. classes)
- Export class diagram to 1. Implement methods of necessary classes to pass unit tests
- Create class Animal.
- Add private field int age;
- Add public method void setAge(int age), which allow to set only non-negative number;
- Add public method int getAge();
- Create class Mammal, which extends Animal.
- Add private field boolean isDomestic;
- Add public method void setIsDomestic(boolean isDomestic);
- Add public method boolean getIsDomestic();
- Create class Bird, which extends Animal.
- Add private field boolean canFly.
- Add public method void setCanFly(boolean canFly);
- Add public method boolean getCanFly();
- Create class Dog, which extends Mammal.
- Add private field String name;
- Add public method void setName(String name), which allow to set only name with letters, starting with capital letter;
- Add public method String getName();
- Create class Hawk, which extends Bird.
- Add private field String color;
- Add public method void setColor(String color);
- Add public method String getColor();
- Right-clik in diagram, select Save as..., choose type PNG Image (*.png) and save ceated class diagram with all mentioned classes in file Animals.png and save it into jtm.extra04 package.
- Select Start menu — Graphics — Dia and create new drawing.
- Choose UML from list of stencils
- Draw UML Class diagram representing classes in jtm.extra04 package (except Test class)
- Export saved diagram into Animals.png file and save it in ../src/main/java/jtm.extra04/ folder of the project
Additional info
Green UML user guide: https://www.clear.rice.edu/comp310/Eclipse/GreenUML/
Dia Diagram editor guide: http://dia-installer.de/shapes/UML/index.html.en
UML standard
- Superstructure — how to use UML
- Infrastructure — UML described with UML itself
Other modeling tools
- IBM System Architect
- Omondo
- Umbrello UML Modeller
- Sketch It! plugin for IntelliJ IDEA
- ObjectAid plugin for Eclipse Modeling Tools
Other UML editors
Other useful editors
| Prev | Next |


