Compared to dealing with a unidirectional functional association, as discussed in the previous chapter, we have to deal with the following new technical issues:
In the controller code we now have to take care of multi-valued reference properties
that require implementing an add and a remove operation.
which mechanism from Parse should be more suitable for One-to-Many or Many-to-Many relations.
In the user interface ("view") code we now have to take care of
showing information about a set of associated objects in the list objects use case;
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.
Comparing Array, Join Table and Parse Relation discussed above, Array is flexible but more complex, there is no exact relation between objects; although Join Table is the classic way to deal with the Many-to-Many relations, it will need to send more requests for a simple purpose; Parse Relation shows its abilities to achieve a better balance between different requests. So we will use Parse Relation in our application.
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
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, so we combine an element
ul and an element