Warning

If it is not explicitly told in following recipe, setting up services are described for Ubuntu 24.04 server, but applications are described for Xubuntu 24.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

UML and forward-reverse engineering

Prev
Practical numbers
Next
Log4J

Main steps

Theory

  1. If necessary, review presentation: UML

Set up tools

  1. If necessary, install some UML forward-reverse engineering tool e.g.:
    1. UML Lab Modeling IDE for Eclipse
      or

    2. UML class diagrams for IntelliJ IDEA
      or

    3. Dia

      sudo apt-get install dia

      or

    4. Calligra Flow

      sudo apt-get install calligra

      or

    5. GreenUML plugin for Eclipse
  2. Investigate how to use them for different diagrams and Class diagrams particularly

Complete exercise

  1. Investigate jtm.extra04 package
  2. Create a class diagram for Animal, Mammal, Bird, Dog, Hawk classes.
  3. Draw UML diagram in jtm.extra04 package (excluding ..Test.. classes)
  4. Export class diagram to 1. Implement methods of necessary classes to pass unit tests
  5. Create class Animal.
    1. Add private field int age;
    2. Add public method void setAge(int age), which allow to set only non-negative number;
    3. Add public method int getAge();
  6. Create class Mammal, which extends Animal.
    1. Add private field boolean isDomestic;
    2. Add public method void setIsDomestic(boolean isDomestic);
    3. Add public method boolean getIsDomestic();
  7. Create class Bird, which extends Animal.
    1. Add private field boolean canFly.
    2. Add public method void setCanFly(boolean canFly);
    3. Add public method boolean getCanFly();
  8. Create class Dog, which extends Mammal.
    1. Add private field String name;
    2. Add public method void setName(String name), which allow to set only name with letters, starting with capital letter;
    3. Add public method String getName();
  9. Create class Hawk, which extends Bird.
    1. Add private field String color;
    2. Add public method void setColor(String color);
    3. Add public method String getColor();
  10. 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.
  11. Select Start menu — Graphics — Dia and create new drawing.
  12. Choose UML from list of stencils
  13. Draw UML Class diagram representing classes in jtm.extra04 package (except Test class)
  14. 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

Other modeling tools

Other UML editors

Other useful editors

Prev
Practical numbers
Next
Log4J

 
 

Created by Valdis Vītoliņš on 2026-03-19 11:59
Last modified by Valdis Vītoliņš on 2026-03-19 13:54
XWiki Powered
Creative Commons Attribution 3.0 Unported License