Table of Contents
In this chapter of our tutorial, we show
how to write the view and controller code based on the model code.
Notice that there are two derived inverse reference properties:
The meaning of the design model and its reference properties
authors can be illustrated by a sample data population for the three model
Table 16.1. Sample data for
|Bantam Books||New York, USA||0553345842|
|Basic Books||New York, USA||0465030793|
Table 16.2. Sample data for
|0553345842||The Mind's I||1982||1, 2||Bantam Books|
|1463794762||The Critique of Pure Reason||2011||3|
|1928565379||The Critique of Practical Reason||2009||3|
|0465030793||I Am A Strange Loop||2000||2||Basic Books|
Table 16.3. Sample data for
|Author ID||Name||Authored books|
|2||Douglas Hofstadter||0553345842, 0465030793|
|3||Immanuel Kant||1463794762, 1928565379|
Create a check operation for each non-derived property. This step has been discussed in detail in the previous parts of the tutorial (about data validation and about unidirectional associations).
Create a set operation for each non-derived single-valued property. In the setter, the corresponding check operation is invoked and the property is only set, if the check does not detect any constraint violation.
Create an add, a remove and a set operation for each non-derived multi-valued property.
Author. Notice that we don't show the model class
Book, since it
is the same as in the data model for the unidirectional association app discussed in the
previous Part of our tutorial.