Anchor modeling - tie: make first role?

256 views Asked by At

Short question related to official anchor modeler.
While modeling ties you can setup roles properties, one of them is "first role".
What does "Make first role" option do?
I see in the xml/sql file it swaps the roles order within a Tie.
Is it only a purely technical setting or there is a business case for it?

1

There are 1 answers

0
Lars Rönnbäck On BEST ANSWER

A tie represents a relationship, which in Anchor modeling is a set of roles on type level. Sets have no ordering, for example {isLeasing, theVehicle, withAgreement} = {withAgreement, theVehicle, isLeasing}, but names of ties are represented as strings in our naming convention. To create a string, some order must be imposed onto the set, and the "Make first role" is only a way to rearrange that order. It is just syntactic sugar, and the semantics of the tie remains the same regardless of the order of the roles in the name. So, with the mentioned example, the tie named PE_isLeasing_VE_theVehicle_AG_withAgreement is the same tie as the one named AG_withAgreement_VE_theVehicle_PE_isLeasing. The tool will even prevent you from creating duplicate ties, should you try to do so. Because of the way we read natural language some orderings are easier to interpret than others though, which would be the "business case" for changing it.