In the first case study, we consider the single-level class hierarchy with root
Book shown in Figure 12.1, which is an incomplete disjoint rigid segmentation. We use the Class Hierarchy Merge design pattern for re-factoring this simple class hierarchy to a single class that can be mapped to a persistent database table.
In the second case study, we consider the multi-level class hierarchy consisting of the
Author, shown in Figure 12.8. The segmentation of
Author does not have any constraints, which means that it is incomplete, overlapping (non-disjoint) and non-rigid.
We use the Class Hierarchy Merge design pattern for re-factoring the simple
Employee sub-hierarchy, and the Joined Tables Inheritance approach for mapping the
Person class hierarchy to a set of three database tables that are related with each other via foreign key dependencies.
In both case studies we show
how to derive a JS class model, and a corresponding entity table model, from the information design model,
how to code the JS class model in the form of JS model classes,
how to write the view and controller code based on the model code.