Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OrderedSet::flatten()
OrderedSet::flatten() [message #61265] Sun, 24 August 2008 06:44 Go to next message
Stefan Schulze is currently offline Stefan SchulzeFriend
Messages: 70
Registered: July 2009
Member
Hi...

according to the OCL specification the operation flatten() isn't defined for
type OrderedSet. (Probably the simply forgot it? It's defined for Set,
Sequence and Bag, too.)
In your implementation (at least in v1.1.2) this operation is defined as
OrderedSet::flatten():Set. I think you decided to implement flatten() for
OrderedSets because it's simply logical. But is it intended to return an Set
instead of an OrderedSet? Sequence::flatten() returns an Sequence, too.

Stefan
Re: OrderedSet::flatten() [message #61312 is a reply to message #61265] Sun, 24 August 2008 14:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Stefan,

The flatten() operation *is* defined by OCL for the OrderedSet type:
it's inherited from Set, which is the supertype of OrderedSet. Because
Set's definition of flatten() returns a Set, naturally it would do the
same when applied to an OrderedSet.

Several other operations are inherited by OrderedSet, too.

Cheers,

Christian

Stefan Schulze wrote:
> Hi...
>
> according to the OCL specification the operation flatten() isn't defined for
> type OrderedSet. (Probably the simply forgot it? It's defined for Set,
> Sequence and Bag, too.)
> In your implementation (at least in v1.1.2) this operation is defined as
> OrderedSet::flatten():Set. I think you decided to implement flatten() for
> OrderedSets because it's simply logical. But is it intended to return an Set
> instead of an OrderedSet? Sequence::flatten() returns an Sequence, too.
>
> Stefan
>
>
Re: OrderedSet::flatten() [message #61383 is a reply to message #61312] Sun, 24 August 2008 19:27 Go to previous messageGo to next message
Stefan Schulze is currently offline Stefan SchulzeFriend
Messages: 70
Registered: July 2009
Member
"Christian W. Damus" <cdamus@zeligsoft.com> schrieb im Newsbeitrag
news:g8rqqd$fk6$1@build.eclipse.org...
> The flatten() operation *is* defined by OCL for the OrderedSet type: it's
> inherited from Set, which is the supertype of OrderedSet. Because Set's
> definition of flatten() returns a Set, naturally it would do the same when
> applied to an OrderedSet.

I expected that OrderedSet inherits Set, but I only found the diagram at
p.172 where OrderedSetType and SetType only extends CollectionType. Because
of this I understood "The OrderedSet is a Set" (p.145) as "The OrderedSet is
a set" (not referring to the class but to the mathematic term).
I'd expect Sequence extending Bag, too, but there I couldn't found anything
("A sequence is a collection" p.145)

Stefan
Re: OrderedSet::flatten() [message #61428 is a reply to message #61383] Sun, 24 August 2008 19:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Stefan,

No, there is no relationship between Bag and Sequence.

The relationship between OrderedSet and Set is indicated only by the one
statement that you quoted. This is one reason why I am working with the
RTF to publish CMOF models of the abstract syntax and the standard
library as formal artifacts in conjuction with the spec.

Cheers,

Christian

Stefan Schulze wrote:
> "Christian W. Damus" <cdamus@zeligsoft.com> schrieb im Newsbeitrag
> news:g8rqqd$fk6$1@build.eclipse.org...
>> The flatten() operation *is* defined by OCL for the OrderedSet type: it's
>> inherited from Set, which is the supertype of OrderedSet. Because Set's
>> definition of flatten() returns a Set, naturally it would do the same when
>> applied to an OrderedSet.
>
> I expected that OrderedSet inherits Set, but I only found the diagram at
> p.172 where OrderedSetType and SetType only extends CollectionType. Because
> of this I understood "The OrderedSet is a Set" (p.145) as "The OrderedSet is
> a set" (not referring to the class but to the mathematic term).
> I'd expect Sequence extending Bag, too, but there I couldn't found anything
> ("A sequence is a collection" p.145)
>
> Stefan
>
>
Re: OrderedSet::flatten() [message #61452 is a reply to message #61428] Tue, 26 August 2008 09:49 Go to previous messageGo to next message
Stefan Schulze is currently offline Stefan SchulzeFriend
Messages: 70
Registered: July 2009
Member
"Christian W. Damus" <cdamus@zeligsoft.com> schrieb im Newsbeitrag
news:g8se2c$5d7$1@build.eclipse.org...
> The relationship [generalization] between OrderedSet and Set is indicated
> only by the one statement that you quoted.

I'm currently working on a different part of my stuff, but accidentally I
came across the OrderedSetType. I think in the implementation OrderedSetType
doesn't inherit SetType but only CollectionType. I'm not really familiar
with these ...Type-classes, so I'm not sure whether I missed something.

It doesn't have an effect at the moment, because all the specified methods
are either assigned to Collection or to OrderedSet and Set seperately. I
only noticed this because I'm working on a executable OCL implementation and
it is related to assigning OrderedSets to Set-variables.

Stefan
Re: OrderedSet::flatten() [message #61476 is a reply to message #61452] Tue, 26 August 2008 13:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Stefan,

Right, the metaclasses defining the Set and OrderedSet types are peers.
In general, there need not be a similar inheritance structure in
metaclasses as in their instances.

I have to ask ... why are you working on an OCL implementation that is
not the MDT OCL component? :-D

cW


Stefan Schulze wrote:
> "Christian W. Damus" <cdamus@zeligsoft.com> schrieb im Newsbeitrag
> news:g8se2c$5d7$1@build.eclipse.org...
>> The relationship [generalization] between OrderedSet and Set is indicated
>> only by the one statement that you quoted.
>
> I'm currently working on a different part of my stuff, but accidentally I
> came across the OrderedSetType. I think in the implementation OrderedSetType
> doesn't inherit SetType but only CollectionType. I'm not really familiar
> with these ...Type-classes, so I'm not sure whether I missed something.
>
> It doesn't have an effect at the moment, because all the specified methods
> are either assigned to Collection or to OrderedSet and Set seperately. I
> only noticed this because I'm working on a executable OCL implementation and
> it is related to assigning OrderedSets to Set-variables.
>
> Stefan
>
>
Re: OrderedSet::flatten() [message #61499 is a reply to message #61476] Tue, 26 August 2008 14:14 Go to previous messageGo to next message
Stefan Schulze is currently offline Stefan SchulzeFriend
Messages: 70
Registered: July 2009
Member
Hi Christian,

I need some support for (mainly) assignment, variable declaration and
object-instanciation. Because of this I wrote a XOCL-component which uses
the MDT OCL component for the plain OCL stuff.
But if anybody is interested in this XOCL-component, I'd give it for free
purpose.

Stefan

"Christian W. Damus" <cdamus@zeligsoft.com> schrieb im Newsbeitrag
news:g90v0p$9m2$1@build.eclipse.org...
> Hi, Stefan,
>
> Right, the metaclasses defining the Set and OrderedSet types are peers. In
> general, there need not be a similar inheritance structure in metaclasses
> as in their instances.
>
> I have to ask ... why are you working on an OCL implementation that is not
> the MDT OCL component? :-D
Re: OrderedSet::flatten() [message #61523 is a reply to message #61499] Tue, 26 August 2008 14:40 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Stefan,

I see. That sounds like the kind of extension to the OCL semantics that
you can find in the OMG's MOF QVT language(s). There's a good deal of
QVT activity in the Eclipse M2M project, if you're interested
participating in that. Although, the small increment of assignment
semantics and object construction would be a practical addition to the
MDT OCL component, for the purpose of using it in specifying behaviours
in EMF- and UML2-based metamodels.

If you would be interested in potentially contributing your work to
Eclipse, I'd be happy to work with you on that.

Cheers,

Christian

Stefan Schulze wrote:
> Hi Christian,
>
> I need some support for (mainly) assignment, variable declaration and
> object-instanciation. Because of this I wrote a XOCL-component which uses
> the MDT OCL component for the plain OCL stuff.
> But if anybody is interested in this XOCL-component, I'd give it for free
> purpose.
>
> Stefan
>
> "Christian W. Damus" <cdamus@zeligsoft.com> schrieb im Newsbeitrag
> news:g90v0p$9m2$1@build.eclipse.org...
>> Hi, Stefan,
>>
>> Right, the metaclasses defining the Set and OrderedSet types are peers. In
>> general, there need not be a similar inheritance structure in metaclasses
>> as in their instances.
>>
>> I have to ask ... why are you working on an OCL implementation that is not
>> the MDT OCL component? :-D
>
>
Previous Topic:If-expressions
Next Topic:Invalid and OclInvalid
Goto Forum:
  


Current Time: Thu Mar 28 23:54:22 GMT 2024

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

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

Back to the top