Practical #1: UML Modeling
Art Gallery
Difficulty: RxWe want to computerise the management of a complex art gallery. All artworks are identified by a number and are characterised by a title, a genre (‘cubism’, ‘impressionism’, ‘pop-art’, …) and are created by an artist. The information to be stored for an artist is their name and date of birth. The gallery may host several exhibitions. Each exhibition consists of several rooms visited in a specific order. Some rooms may be shared by multiple exhibitions. Each room has a unique number and a name. A room contains several walls where the different artworks are displayed.
UML Modelling
The first step is to model the requirements described above using UML. To do this, you
will use the UML tool Modelio by simply typing the following command in a terminal:
modelio
or if that does not work:
/usr/local/modelio/modelio
Creating a New Project
Create a new project via the menu (File→Create a project). The UML project name will be:
yourLoginGallery. Then, in your project tree, create a diagram via the menu
(Create Diagram...) and specify, using the dropdown menu, that it is a class diagram.
Modelling the Gallery
Model the art gallery case using Modelio, keeping in mind the following constraints:
- Each association must have a name.
- Entities must have an attribute stereotyped as
Identifieror{key}. - The recognised attribute types are
string,real,boolean,integer,charanddate.
To create an entity or a relationship, click on the corresponding icon on the left. You can rename them via the Properties tab. To add an attribute, right-click on the entity.
Rugby World Cup
Difficulty: RxWe are interested in organising Rugby World Cup matches. The federation wants to be able to retrieve, for each national team, its unique name in the system (TEAMNAME), the country it represents (COUNTRY) and the full list of players in the squad. Each player has a number within their team printed on their shirt (PLAYERNUM), a surname (SURNAME), a first name (FIRSTNAME), a weight (WEIGHT) and a position in the team, such as ‘Three-quarter’ (POSITION). Matches between the different teams must be retrievable in the system via their unique number (MATCHNUM). For each match, we want to know which two teams participated, the date (DATE) and time (TIME) of the fixture, the stadium used (STADIUM), and the final result expressed as a string containing the points scored by each team, for example ‘22-30’ (RESULT). For each player participating in a match, we want to be able to record a commentary on their performance during the match (COMMENTS). We also want to record all the points (POINTS) scored during the match by that player, along with the type of score, such as a penalty, a try, a conversion, etc. (TYPE). For each team, we also want to know their final ranking (RANK) in the competition, i.e. who finished first, second, third, etc. For each player, we want to know their home club (CLUB) at the time of the competition.
Modelling
The UML project name will be: yourLoginRugby.