Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » AggregationKind(How do I determine the "aggregation kind" for an association?)
icon9.gif  AggregationKind [message #1061814] Tue, 04 June 2013 04:22 Go to next message
Eclipse UserFriend
I am using acceleo to generate an XSD from a UML model.

I want to be able to create different types of structures depending the type of association (i.e. Composition, Shared Aggregation, None).

A sample piece of Test Code below gives you the idea...

--- Code ---
[for (anAssociation : Association | aClass.getAssociations())]
[if( anAssociation.attribute.aggregation <--- ) /]
...
[/if]
[/for]
--- End Code ---

What do I actually do with the AggregationKind entity to determine what type of aggregation it is?

Help much appreciated.
Re: AggregationKind [message #1062511 is a reply to message #1061814] Sat, 08 June 2013 03:31 Go to previous messageGo to next message
Eclipse UserFriend
I Mark the aggreagation kind is a property of the association's member ends.
You shold thus look for

anAssociation.memberEnd->at(1).aggregation

and

anAssociation.memberEnd->at(2).aggregation


See http://lowcoupling.com/post/47801917915/understanding-uml-associations
for further details about UML Associations

Regards

[Updated on: Sat, 08 June 2013 05:16] by Moderator

Re: AggregationKind [message #1062647 is a reply to message #1062511] Mon, 10 June 2013 04:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I assume that AggregationKind is an enumeration, so in order to compare it you would have to do something like this:
[if(myObject.aggregation = Aggregation::composite)]composite[/if]


Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks
Re: AggregationKind [message #1064216 is a reply to message #1062647] Tue, 18 June 2013 06:14 Go to previous message
Eclipse UserFriend
hi guy,
you can do dirrectly get your aggregation, inheritance and others. Maybe it can be better.
You can do:
p.aggregation.toString().strcmp('composite') --> For acomposition,
p.aggregation.toString().strcmp('shared') --> For an aggregation
Previous Topic:Customize the launcher unit
Next Topic:[Acceleo] Problems during code re-generation
Goto Forum:
  


Current Time: Thu Apr 17 21:57:48 EDT 2025

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

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

Back to the top