In Java,both set-valued and ordered-set-valued reference properties, such as
Author::authoredBooks
and Book::authors
in the example model
below, can be implemented with the pre-defined generic interface type
List<T>
as their range. However, it seems that set-valued reference
properties should be rather implemented with Set<T>
, such as declaring
Set<Book>
as the range of Author::authoredBooks
, while
ordered-set-valued reference properties should be implemented with
SortedSet<T>
, such as declaring SortedSet<Author>
as the
range of Book::authors
. This issue has still to be investigated for future
editions of this tutorial.
Figure 13.1. An example with a set-valued reference property authoredBooks
and an
ordered-set-valued reference property authors