in

The ORM Foundation

Get the facts!

Three-part reference scheme for rooms

Last post Wed, Mar 3 2010 15:34 by Matthew Curland. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Wed, Mar 3 2010 7:06

    • vkannel
    • Top 50 Contributor
    • Joined on Wed, Feb 10 2010
    • Posts 19

    Three-part reference scheme for rooms

    I have created with NORMA scheme for rooms (according to Halpin book page 185)

    BUT, Verbalization Browser shows me two errors. Could anyone explain what they mean, how to fix schema and does it mean that book example is also wrong?

    Verbalization Browser text:

    For each Building, all or none of the following hold:
    some Room is in that Building;
    some Room has that Floornr;
    some Room has that SerialNr.

    Model Error: Constraint 'EqualityConstraint1' in model 'ORMModel1' has role players with incompatible types.
    Model Error: Constraint 'EqualityConstraint1' in model 'ORMModel1' has role players with incompatible types.


  • Wed, Mar 3 2010 15:34 In reply to

    Re: Three-part reference scheme for rooms

    Hello,

    There are several things going on here. Most importantly, the constraint shown on page 185 is a preferred external uniqueness constraint, not an equality constraint. You'll need to delete the equality constraint from your model and add a uniqueness constraint in its place. Note that the constraint editor behaves differently for set constraints (Uniqueness, Mandatory, Frequency, Ring) than set comparison constraints (Equality, Exclusion, Subset). You can see directions for different types in the tooltip that is visible over the constraint when a constraint editor is active. Once you've added the external uniqueness constraint, you can set the constraint's IsPreferredIdentifier property in the Properties Window to get the graphic shown in the book.

    The verbalization for the next drop (coming before the end of the week) will correctly handle column compabitility and join paths on set comparison constraints. The verbalization now reads:

    For each Building, all or none of the following hold:
      some Room is in that Building;
      some Room has some SerialNr that is that Building;
      some Room has some FloorNr that is that Building.

    This makes it obvious that the constraint is poorly formed and backs up the error text indicating incompatible types. The older verbalization uses a dangling 'that' back reference for FloorNr and SerialNr, which is structurally poorly formed (although subtle). It is more obvious that the constraint is bogus for the new verbalization because a Building is neither a SerialNr nor a FloorNr.

    I don't know why this is generating two equivalent errors. I'll look into it. It should be an easy fix for new errors (removing existing duplicates on load would be a lot more work and isn't worth the effort).

    -Matt

Page 1 of 1 (2 items)
© 2008-2024 ------- Terms of Service