Part IV. Associations

Associations are important elements of information models. They describe relationships between object types assigning objects of one type to objects of another type. Software applications have to implement them in a proper way, typically as part of their model layer within a model-view-controller (MVC) architecture. Unfortunately, application development frameworks do often not provide much support for dealing with associations.

Table of Contents

8. Reference Properties and Unidirectional Associations
1. References and Reference Properties
2. Referential Integrity
3. Modeling Reference Properties as Unidirectional Associations
4. Representing Unidirectional Associations as Reference Properties
5. Adding Directionality to a Non-Directed Association
6. Our Running Example
7. Eliminating Unidirectional Associations
7.1. The basic elimination procedure
7.2. Eliminating associations from the design model
8. Rendering Reference Properties in the User Interface
9. Collection Types for Multi-Valued Reference Properties
10. Quiz Questions
10.1. Question 1: Meaning of "one-to-one"
10.2. Question 2: When to Check Referential Integrity
10.3. Question 3: Meaning of "Functional"
10.4. Question 4: Object Destruction Dependency
10.5. Question 5: Rendering a Single-Valued Reference Property
10.6. Question 6: Expressing a Functionality Type
9. Unidirectional Functional Associations in Plain JS
1. Implementing Single-Valued Reference Properties
2. Make a JS Class Model
3. New Issues
4. Code the Model
4.1. Summary
4.2. Code each model class as a JS class
4.3. Code the property checks
4.4. Code the property setters
4.5. Choose and implement a deletion policy
4.6. Serialization functions
5. Code the View
5.1. Setting up the Retrieve/List All user interface
5.2. Setting up the Create and Update user interfaces
6. Quiz Questions
6.1. Question 1: Single-valued reference property
6.2. Question 2: Implementing the CASCADE deletion policy
6.3. Question 3: JS class model
10. Unidirectional Non-Functional Associations in Plain JS
1. Implementing Multi-Valued Reference Properties
2. Make a JS Class Model
3. New issues
4. Code the Model
4.1. Summary
4.2. Code the add and remove operations
4.3. Choose and implement a deletion policy
4.4. Serialization functions
5. Code the View
5.1. Setting up the Retrieve/List All user interface
5.2. Selecting associated objects in the Create user interface
5.3. Selecting associated objects in the Update user interface
6. Points of Attention
7. Quiz Questions
7.1. Question 1: Collection-valued properties
7.2. Question 2: Implementing the CASCADE deletion policy
7.3. Question 3: JS class model
11. Unidirectional Associations Practice Projects
1. Assign a director and actors to a movie
2. Assign cities and a capital to a country, and members to an organization
12. Bidirectional Associations
1. Inverse Reference Properties
2. Making an OO Class Model
2.1. The basic procedure
2.2. How to eliminate unidirectional associations
2.3. How to eliminate bidirectional associations
2.4. The resulting OO class model
3. Quiz Questions
3.1. Question 1: Table populations of bidirectional associations
3.2. Question 2: Implications of bidirectionality
3.3. Question 3: Elimination of bidirectional associations
3.4. Question 4: Meaning of bidirectional association
13. Bidirectional Associations in Plain JS
1. Make a JavaScript Class Model
2. Write the Model Code
2.1. New issues
2.2. Coding Summary
2.3. Code each class of the JS class model
2.4. Code the set methods of single-valued properties
2.5. Code the add and remove operations
2.6. Suppress the storage of the values of derived properties
2.7. Take care of deletion dependencies
3. Exploit Inverse Reference Properties in the User Interface
3.1. Show published books in Retrieve/List All publishers
4. Quiz Questions
4.1. Question 1: Adding references
4.2. Question 2: Maintaining a pair of mutually inverse reference properties
4.3. Question 3: Making a JS class model
14. Bidirectional Associations Practice Projects
1. Assign directors/actors to movies and movies to directors/actors
2. Assign cities to a country and members to an organization, and vice versa
15. Part-Whole Associations
1. Aggregation
2. Composition