Part III. Enumerations

In virtually any app, we need to deal with attributes having a fixed set of possible values representing names. These attributes are called enumeration attributes, and their fixed value sets are called enumerations.

Table of Contents

10. Enumeration Attributes
1. Enumerations
1.1. Simple enumerations
1.2. Code lists
1.3. Record enumerations
1.4. Extensible enumerations
2. Enumeration Attributes
3. Enumerations in Computational Languages
3.1. Enumerations in SQL
3.2. Enumerations in XML Schema
3.3. Enumerations in JavaScript
4. Dealing with Enumeration Attributes in a Design Model
5. Quiz Questions
5.1. Question 1: Languages Supporting Enumerations
5.2. Question 2: UI Widget for Single-Valued Enum Attribute
5.3. Question 3: UI Widget for Multi-Valued Enum Attribute
11. Enumeration Attributes in Plain JS
1. New Issues
2. Make a JavaScript Class Model
3. Add the Library File Enumeration.js
4. The Meta-Class Enumeration
5. Write the Model Code
5.1. Code the enumerations
5.2. Code the model class as an ES6 class
5.3. Code the implicit getters and setters
5.4. Code the enumeration attribute checks
5.5. Write a serialization function
5.6. Data management operations
5.7. Creating test data
6. Write the View Code
6.1. Selection lists
6.2. Radio button and checkbox groups
6.3. Responsive validation for choice widgets
7. Run the App and Get the Code
8. Practice Projects
8.1. Project 1 - Adding ratings and genres as enumeration attributes
8.2. Project 2 - Adding country codes and religions as enumeration attributes
9. Quiz Questions
9.1. Question 1: Checking the range constraint of an enumeration attribute
9.2. Question 2: Computing MAX
12. Enumeration Attributes in Java EE
1. New Issues
2. Make an Entity Class Model
3. Write the Model Code
3.1. Code the enumerations
3.2. Code the JPA entity class
3.3. Define a converter for serializing enumeration attribute values
3.4. Code the enumeration attribute setters
3.5. Write a serialization function
3.6. Database schema
3.7. Creating test data
4. Write the View Code
4.1. Selection lists
4.2. Radio button groups and checkbox groups
5. Displaying Value Sets for Multi-Valued Enumeration Attributes
6. Run the App and Get the Code
7. Practice Projects
7.1. Project 1 - Adding ratings and genres as enumeration attributes
7.2. Project 2 - Adding country codes and religions as enumeration attributes
8. Quiz Questions
8.1. Question 1: JPA custom converter implementation class
8.2. Question 2: Cardinality constraints for enum attributes
8.3. Question 3: JPA enum attribute serialization annotation
8.4. Question 4: JSF single-valued enum attribute
8.5. Question 5: JSF multi-valued enum attribute