Object role values with external ref scheme

Christina
2007-06-11
2013-05-28
  • Christina
    Christina
    2007-06-11

    Hi,
    I have an object type with an external reference scheme composed of two values
    (the object type participates in two associations, I have added an external uniqueness constraint on these associations, and I have etxtended the reference scheme for my object type).
    I would like to add the object type in an association indicating the role values of the object that can participate in the association.
    Hence, my problem is indicating the allowed objects in the role values since, if I have understood correctly, it must be referenced with two values.

    thanks,
    xristina

     
    • Hi xristina,

      This looks like another problem where it would be much easier to analyze if we could look at the model, or model fragment you are working with.  Absent that, using the same verbalization for FactTypes that the tool generates can help.  Still, we can look at each of the statement/phrases in your post, and see if my interpretation (in an ORM context), matches yours.

         "I have an object type with an external reference scheme composed of two values
      (the object type participates in two associations, I have added an external uniqueness constraint on these association...."

      ==>  A composite object type, with an external uniqueness constraint (serving as the reference mode for the composite object type - that is, an EUC connected to the proper role in each of two FactTypes in which the ObjectType participates.

          "..., and I have etxtended the reference scheme for my object type)."

      ==>  Unless you are restating the previous part in other words, I don't understand this.

          "I would like to add the object type in an association indicating the role values of the object that can participate in the association."

      ==>  You wish to use the composite object mentioned in new FactType; and you want to place a constraint in this new FactType that will limit the allowed values to those within some series or list.

      At this point, I'd need to know what you (as the modeler), are attempting to represent in your ORM.  What statements of fact or business rules are you attempting to embody in your model.  I can guess two possiblities: a) The composite object reference mode (the first two FactTypes mentioned, with the EUC), is separate from any other FactTypes for that object. b)This new FactType should form part of the composite object type's reference scheme - the EUC should have connected three roles (each in a separate FactType), rather than two.

      See if this example comes close:

          A Phone has a primary reference based on the PhoneNumber(Num) and PhoneType(Type).  So, 555-4321 and Cell uniquely identify a phone.  Now, you add another FactType that involving Phone: Phone is assigned to Employee.  In this example, you may wish to limit employees that get assigned phones.  Adding a value constraint for this new FactType concerns only the values for Employee - so no need to worry about limiting two values.

          A variation on this would be if you started with the same composite object type for Phone, but realized that to be unique, you had to add an designation to indicate a physical device designation: SerialNumber(Num) - so you can upgrade, etc....  In this case you'd have three FactTypes connected to Phone, and the EUC would connect to one role in each of the three predicates.  Now, 555-4321 and Cell and 987654321 is a unique instance of the Phone composite object type.  From here, you can add other FactTypes as in the assignment of phones to Employees mentioned.  You can put a restriction on any of the values mentioned.  So, you can limit the values for employees that get phones, or limit the types of phones assigned, or limit the "new" phones (as a list a of serial numbers), to certain employees, etc....

          If I completely missed the mark on your question, let me know.  If you can provide your own examples, or twist mine into what you need, do that.  Hope it helps.  BRN..

       
    • Christina
      Christina
      2007-06-12

      Hi,
      thanks for the quick answer. In the example of the phone what I want to restrict are the allowed values for the phone number and type. I do not want to limit just the type of phones or the corresponding number but the combination of them in the values for a role played by phone.

      thank you,
      xristina

       
      • Hi,

        The first thing that comes to mind is a disjunctive mandatory role constraint, with value constraints placed on the role in each FactType involved.  So, you could have a  FactType something like: (if you want all phones to be limited to this combination)
            Phone has Number (value set constraint)
            Phone has Type (value set constraint)
            (with a DMRC on Phone to each role predicate)

        That should limit instances of Phone to only the logical AND of the two value constraints.

        If you want to impose combination restrictions on only some phones, you'll want to add new FactTypes to express the rule(s) you are modeling, but I think a DMRC will still be part of that answer.

        I haven't tried this with NORMA yet.  Also, even if it works with ORM, you'll want to take a close look at any auto-generated DDL script from NORMA.  One way to avoid common DDL errors is to name the roles in your ORM model (especially important in Ring Constraints).  One of the team members mentioned that more robust DDL generation will be part of the next CTP of NORMA - hope it arrives soon!  BRN..