Skip to main content


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] Thu, 21 August 2008 03:33 Go to next message
Stefan Schulze is currently offline Stefan SchulzeFriend
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 12:56 Go to previous message
Eclipse UserFriend
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 Apr 23 06:50:37 GMT 2024

Powered by FUDForum. Page generated in 0.03205 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top