Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Containers and recursion: container A has container B and container B has container A
Containers and recursion: container A has container B and container B has container A [message #1596104] Sun, 01 February 2015 12:07 Go to next message
sninja sninja is currently offline sninja sninjaFriend
Messages: 31
Registered: October 2013
Member
Hi,

Here is model example:

http://api.ning.com/files/yKWLMefqYBwKEt5ysGsR6YSer*eeqx7VlJDBE-XUVy7Br1zsX*2y*xf9pG7Gtie4JW58f1mTQ9w0XFdeHAiAHziqkURIFJ2K/if_while_model.png

How to represent that in .odesign file?

I want IfCondition to be container and WhileLoop to be container. If can have another if and/or while inside, which can have inside themselves another if and/or while and so on. Same thing for while.

Is it enough just to make new container inside IfCondition container and use Reused container mappings: IfCondition, WhileLoop from Import tab? Same thing for WhileLoop container.

What is my domain class for that inside containers? Do I leave it empty?

If I already have tools for If and While container, do I need to make another tools for those inside containers?

Thanks.
Re: Containers and recursion: container A has container B and container B has container A [message #1601283 is a reply to message #1596104] Wed, 04 February 2015 21:24 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Le 01/02/2015 13:07, sninja sninja a écrit :
> Hi,

Hi,
>
> Here is model example:
>
>
>
> How to represent that in .odesign file?
>
> I want IfCondition to be container and WhileLoop to be container. If can
> have another if and/or while inside, which can have inside themselves
> another if and/or while and so on. Same thing for while.
>
> Is it enough just to make new container inside IfCondition container
> and use Reused container mappings: IfCondition, WhileLoop from Import
> tab? Same thing for WhileLoop container.

>
> What is my domain class for that inside containers? Do I leave it empty?

I think you do not need an inside container.
From your screenshot, I would create:
. One Container mapping with domain class IfCondition
. One Container mapping with domain class WhileLoop

Then for each mapping, I would add (Import tab) both mappings has reused
container mappings. But you have to adapt you semantic candidates
expression to support the recursion (feature:eContents should be ok).

Another tip, for your ecore I would create a common supertype for
IfCondition and WhileLoop, adds to it one containment reference typed by
itself and delete your whileHasIf, whileHasWhile, ifHasIf and ifHasWhile
references. This structure could allow you to mix/order WhileLoop and
IfCondition.

>
> If I already have tools for If and While container, do I need to make
> another tools for those inside containers?

With the proposed mapping structure you should not need additional tools.

>
> Thanks.


Regards,


--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Draw edges after dragging an entity on the diagram
Next Topic:External Java Action with null parameters
Goto Forum:
  


Current Time: Wed Sep 25 22:17:27 GMT 2024

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

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

Back to the top