Modeling of unique Attributes (maybe just a newbie problem)

classic Classic list List threaded Threaded
2 messages Options
Tom
Reply | Threaded
Open this post in threaded view
|

Modeling of unique Attributes (maybe just a newbie problem)

Tom
Hi

First of all I want to thank the developers of the Anchor Modeling concept and of the beautiful modeler tool for their effort.

I'm currently working on a POC for a core data system where the temporal support and the simple evolution possibilities of Anchor Modeling seem to be good solution for some of the key requirements. While exprimenting with the modeling tool I have stumbled upon the following question:

What is the "correct" way to model unique attributes?

Explanation:
In 3NF a table contaning ISO country information (https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) there are often several fields which contain a unique value (e.g. 2 digit ISO country code, 3 digit ISO country code, numeric ISO country code).
I've create a Country anchor, plus a bunch of attached attrubutes for those values, but I have no idea how to enforce the uniqueness of the mentioned code (fields marked green).
 
Country model



Any hints would be appreciated. Thanks.

Tom
Tom
Reply | Threaded
Open this post in threaded view
|

Re: Modeling of unique Attributes (maybe just a newbie problem)

Tom
Got to answer my own question (should have read more before asking ;) ):

The article Implementing Constraints explains what to do.

It would still be great if the modeling tool would directly support simple constraints like unique attributes and ties.