EP. 14 - Enumeration Data Definitions
Enumeration data definitions are used to represent information that has 2 or more distinct values.For example, We are designing a data definition for student grades. The grade can be A, B or C.
In this problem domain, the grade can have 3 different values, which is A, B or C. Since we have a data which can have 3 distinct values, it makes sense that we use Enumeration for our template to make our data definitions.
When making the Type Comment of the Enumeration Data Definition. We need to enumerate each distinct value.
When interpreting enumeration, this tends to be straightforward.
On enumerations, we do not need to have examples since they are redundant. The examples are already in our type comment.
For the enumeration template, we need to make an if-conditions that would cover all the distinct values that we have here, in a Condition and the Corresponding expression.
Since the individual distinct value now is considered Atomic. We can refer to the Atomic Distinct Value as reference on designing our template relevant to the data definition.
The data values are strings, so we will use the template appropriate for strings.
And this is the data definition template for Enumeration. Enumerations are data that have distinct values.
Mga Komento
Mag-post ng isang Komento