Datastructures and unique

Hi,

In the RM-datastructures, like ItemList and itemTree, there is no
structure to implement a the effect of the ADL keyword "unique".
A Set is the Java-way to enforce "unique".
But a Set is not allowed in the RM-container-datastructures.

How can this be solved?

Thanks for any thoughts.
Bert Verhees

Hi Bert,

The meaning of the ‘unique’ constraint is that in the data there may be no multiple instances (i.e. nodes) of a give at-code.Implementing it just means that the archetype checking function has to check for non-repetition of at-codes on nodes under an attribute (e.g. History.events or whatever).

I personally suspect we should get rid of this constraint, because occurrences is a more obvious way to control this.

  • thomas

Thanks Thomas,

It slipped from my mind, I misunderstood

Bert

Op 13-10-10 13:32, Thomas Beale schreef:

I think that the original message from Bert was right. Occurrences control the number of instances but the “unique” keyword controls that they have no data repetitions (by value). As the documentation says, it represents a logical set. So both constraints are needed for different things.

David

2010/10/13 Thomas Beale <thomas.beale@oceaninformatics.com>

I am sorry to again come back on my own words, David is right, the occurences keyword is used to constrain the occurences of a specific “atcode”
The cardinality is indeed for containers, and then my original problem also comes up again, the RM-datastructures do not have a way to implement the “unique” behaviour.

Just in time, David, I had just started to change my code. :wink:

Bert

Op 13-10-10 13:47, David Moner schreef: