Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » ..*-associations should be Set by default?
..*-associations should be Set by default? [message #61100] Wed, 20 August 2008 23:33 Go to next message
Stefan Schulze is currently offline Stefan Schulze
Messages: 70
Registered: July 2009
Member
Hi...

I stumbled upon something I read in the OCL specification:
In chapter 7.5.3 of OCL 2.0 (formal/06-05-01) on page 16 I read that "By
default, navigation will result in a Set." I think this is really strange,
because the UML dedicated the constraint {unique} for association-ends to
turn it into a Set. So according to the UML it should be a Bag by default.
How could I specify a association-end to be a Bag according to the
OCL-specification?
Can anybody point me to what I missed?

Stefan
Re: ..*-associations should be Set by default? [message #61124 is a reply to message #61100] Thu, 21 August 2008 08:56 Go to previous message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

Hi, Stefan,

This statement in the specification is, technically, correct. The UML
stipulates for MultiplicityElement these default (meta-)attribute values:

isOrdered = false
isUnique = true

Thus, the default collection type for mulivalued features is Set.

To get a bag, you must explicitly set isUnique to false.

HTH,

Christian

Stefan Schulze wrote:
> Hi...
>
> I stumbled upon something I read in the OCL specification:
> In chapter 7.5.3 of OCL 2.0 (formal/06-05-01) on page 16 I read that "By
> default, navigation will result in a Set." I think this is really strange,
> because the UML dedicated the constraint {unique} for association-ends to
> turn it into a Set. So according to the UML it should be a Bag by default.
> How could I specify a association-end to be a Bag according to the
> OCL-specification?
> Can anybody point me to what I missed?
>
> Stefan
>
>
Previous Topic:Calling methods with enum-parameter
Next Topic:Calling overriding methods
Goto Forum:
  


Current Time: Tue Jul 22 11:50:43 EDT 2014

Powered by FUDForum. Page generated in 0.02463 seconds