2. Project 2 - Country Code and Religions as Enumeration Attributes

The purpose of the app to be built is managing information about countries. The app deals with just one object type, Country, and with two enumerations, as depicted in the following class diagram. In the subsequent parts of the tutorial, you will extend this simple app by adding international organizations and cities as further model classes, and the associations between them.

Figure 10.2. The object type Movie defined together with two enumerations.

The object type Movie defined together with two enumerations.

Compared to the practice project of our validation tutorial, two attributes have been added: the single-valued enumeration attribute code, which is a "key" attribute (implying a uniqueness constraint), and the multi-valued enumeration attribute religions.

You can use the following sample data for testing your app:

Table 10.2. Sample country data

Name Code Population Life expectancy Religions
Germany DE 80,854,408 80.57 Protestant, Catholic, Muslim
France FR 66,553,766 81.75 Catholic, Muslim
Russia RU 142,423,773 70.47 Orthodox, Muslim
Monaco MC 30,535 89.52 Catholic

More data about countries can be found in the CIA World Factbook.