7. Unified Modeling Language
Main steps
Set up tools
Install Dia :
sudo apt-get install diaand, if it works, also Calligra Sheets:
sudo apt-get install calligraand investigate how to use them for different diagrams.
- (If it is not done already) download Eclipse IDE for Enterprise Java Developers from bcserver (if available) or from Eclipse website and extract it in IDEs folder. (If necessary, look for more info here in Latvian).
- Install GreenUML plugin
Complete exercise
- Investigate jtm.activity07 package
Use GreenUML to create a class diagram for Animal, Mammal, Bird, Dog, Hawk classes. - Create class diagram with Green UML:
- select menu File — New — Other...,
- in wizard tree select Green UML — Green UML Class Diagram and press Next,
- in wizard select activity07 for name enter: Animals and press Finish.
- Draw UML diagram in jtm.activity07 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 ...activity07 package.
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
- JavE ASCII editor
- ditaa ASCII to png editor
- MOLA editor (for Windows only)