Note, that this recipe is not updated long time and could be outdated!
Got it.

8. Unified Modeling Language

Main steps

General info

  1. Review presentation UML

    Practical exercise

Complete exercise

  1. Investigate jtm.activity07 package
  2. 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();
  3. 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();
  4. 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();
  5. 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();
  6. 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();
  7. Select Start menu — Graphics — Dia and create new drawing.
  8. Choose UML from list of stencils
  9. Draw UML Class diagram representing classes in jtm.activity07 package (except Test class)
  10. Export saved diagram into Animals.png file and save it in ../src/main/java/jtm/activity07/ 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


  

Created by Valdis Vītoliņš on 2020-05-28 10:55
Last modified by Valdis Vītoliņš on 2021-05-27 16:20
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License