Chapter 3. Implementing Unidirectional Non-Functional Associations with Plain JS

Table of Contents
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 and Object-to-Storage Mapping
5. Code the View
5.1. Showing information about associated objects in Retrieve/List All
5.2. Selecting associated objects in the Create use case
5.3. Selecting associated objects in the Update use case
6. How to Run the App and Get the Code
7. Points of Attention

A unidirectional non-functional association is either one-to-many or many-to-many. In both cases such an association is represented, or implemented, with the help of a multi-valued reference property.

In this chapter, we show

  1. how to derive a JS class model from an OO class model with multi-valued reference properties representing unidirectional non-functional associations,

  2. how to code the JS class model in the form of JavaScript model classes,

  3. how to write the view and controller code based on the model code.