Skip to main content



      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 07:07 Go to next message
Eclipse UserFriend
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 16:24 Go to previous message
Eclipse UserFriend
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
Previous Topic:Draw edges after dragging an entity on the diagram
Next Topic:External Java Action with null parameters
Goto Forum:
  


Current Time: Sat May 24 19:50:31 EDT 2025

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

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

Back to the top