3. New issues

Compared to dealing with a unidirectional functional association, as discussed in the previous chapter, we have to deal with the following new technical issues:

  1. In the model code we now have to take care of multi-valued reference properties that require

    1. implementing an add and a remove operation, as well as a setter for assigning a set of references with the help of the add operation.

    2. converting a map of internal object references to an array of ID references in the serialization function convertObj2Row and converting such an array back to a map of internal object references in the de-serialization function convertRow2Obj.

  2. In the user interface ("view") code we now have to take care of

    1. showing information about a set of associated objects in the list objects use case;

    2. allowing to select a set of associated objects from a list of all existing instances of the target class in the create object and update object use cases.

The last issue, allowing to select a set of associated objects from a list of all existing instances of some class, can, in general, not be solved with the help of an HTML select multiple form element because of usability problems. Whenever the set of selectable options is greater than a certain threshold (defined by the number of options that can be seen on the screen without scrolling), the HTML select multiple element is no longer usable, and an alternative multi-select widget has to be used.