|
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 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03280 seconds