Figure 10 ORM subschemas for details about Books and Shipments.
4 Possible benefits of ORM for DEMO
As explained in section 2, the DEMO approach uses a state model to declare the “essential” fact types and
rules pertaining to the real world objects in the application domain. A state model is specified using an
object-fact diagram supplemented by an object property table. Figure 5 shows the state model for the
library application. Collectively, Figure 7, Figure 9 and Figure 10 provide an ORM model for the library
application. A comparison between these two models reveals some important differences.
An ORM model is intended to capture all the fact types that are of interest in the application domain,
as well as all static business rules (constraints and derivation rules that apply to each individual state of the
information system) that need to be enforced. ORM models are also formal, so that they can be
automatically transformed into implementation models. For these reasons, ORM models tend to be more
complete and precise than corresponding DEMO state models.
The first major addition provided by ORM models is their inclusion of at least one identification
scheme for each entity type. For example, in Figure 7 we see that each loan is identified by a loan number,
and each book copy is identified by a barcode. In addition, we see that each book copy can be identified by
combining the call number of its book with a copy number. Any reference scheme that is to be used in the
application is considered relevant. Apart from being needed for the operation of the information system,
such identification schemes enable the modeler to use real examples when populating fact types for
validation purposes (as shown in Figure 6). This makes it much easier to decide whether the model
accurately reflects the application domain. As DEMO considers the choice of any identification scheme as
non-essential, this kind of information is ignored.
The second major difference is that ORM models typically capture more constraints. For example, the
DEMO-SM ignores any dependency between the unary fact types PE05 (BookCopy has been returned) and
PE04 (Loan has ended to exist) because this is captured in the OM (and consequently in the PM). To enforce
the dependency, the ORM model includes a subset constraint between the loan-return and loan-end fact
types to ensure that each returned loan is classified as ended. In general, ORM’s constraint language is
more powerful (e.g. see Halpin, 2002b * MERGEFORMAT ).
A third addition provided by ORM models is that all temporal aspects are declared explicitly. For
example, consider the DEMO unary fact type PE04: Loan has started to exist. Like any other DEMO fact type,