Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:22 Go to next message
Mark Hunter is currently offline Mark HunterFriend
Messages: 1
Registered: June 2013
Junior Member
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 07:31 Go to previous messageGo to next message
Low Coupling is currently offline Low CouplingFriend
Messages: 30
Registered: June 2013
Member
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 09:16]

Report message to a moderator

Re: AggregationKind [message #1062647 is a reply to message #1062511] Mon, 10 June 2013 08:53 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

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 10:14 Go to previous message
Félix SILINOU KAMDEM is currently offline Félix SILINOU KAMDEMFriend
Messages: 96
Registered: April 2013
Member
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 25 13:12:02 GMT 2024

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

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

Back to the top