Using the information design model shown in Figure 6.1 above as the starting point, we make a JavaBean data model with getters/setters and corresponding Java datatypes.
The data model defines the following constraints:
The isbn
attribute is declared to be a standard identifier, implying
that it is mandatory and unique.
The isbn
attribute has a pattern
constraint requiring its values to match the ISBN-10 format that admits
only 10-digit strings or 9-digit strings followed by "X".
The title
attribute is mandatory.
The year
attribute is mandatory and
has an interval constraint, however, of a special form
since the maximum is not fixed, but provided by the calendaric function
nextYear()
.