Book a Demo

Author Topic: isOrdered & isUnique Attributes?  (Read 7034 times)

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
isOrdered & isUnique Attributes?
« on: October 07, 2005, 06:19:27 pm »
In the UML 2 Superstructure document, Section 7.3.36 (page 105) under the heading Attributes (of Operation) The following text appears:
Quote
• /isOrdered : Boolean Specifies whether the return parameter is ordered or not, if present. This is derived.
• isQuery : Boolean Specifies whether an execution of the BehavioralFeature leaves the state of the system
unchanged (isQuery=true) or whether side effects may occur (isQuery=false). The default
value is false.
• /isUnique : Boolean Specifies whether the return parameter is unique or not, if present. This is derived.
The definitions of isOrdered and isUnique are semi-circular.

Can anyone tell me what ordered and unique mean in the context of this section of the UML?

Verbal Use Cases aren't worth the paper they are written upon.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: isOrdered & isUnique Attributes?
« Reply #1 on: October 08, 2005, 01:17:06 am »
Jim,

The isOrdered and isUnique Attributes or the Operation behavioural feature aren't semi-circular, but they do have to do with what we're discussing in other threads...

Class Attributes can be Collections (I stereotype them «collective»).  EA supports this (see Details Tab of Attributes Dialog)

The Return Parameter can also be a Collection.  EA supports this (see ReturnArray Checkbox on Operations Dialog)

isOrdered and isUnique are Properties of Collections.  isOrdered defines whether the Collection maintains an internal ordering based upon the identifier of the items such that a sequential traversal of the items will yield and ordered sequence.
isUnique defines whether there can only be one item with a given identifier in the collection.

If I remember my maths right, Sets have to be unique but don't have to be ordered.  Sequences have to be ordered but don't have to be unique.  Thus the two attributes control the four types of Collections:
O U           Type
Y  Y   Ordered Set or Unique Sequence (same thing)
Y  N   Sequence
N  Y   Set
N  N   Bag (neither a Sequence nor a Set)

HTH,
Paolo


Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!