Home » Modeling » EMF » Reuse of models in a hierarchical way
Reuse of models in a hierarchical way [message #1062022] |
Wed, 05 June 2013 08:58  |
Eclipse User |
|
|
|
Hi all,
I'm defining a meta-model and a graphical editor with GFM.
I have an hierarchical containment: the root element is model, which contains package. Package can contain other packages.
I would like to define a package and reuse it in several high-level packages.
I would like to see the modification performed in a low-level package in all the models that reuse it. For this reason I though to use something like the load resource functionality, however I always used it for references, and not containments.
How can I do the same with containments?
I read about containment proxies, however I also read that it is possible to have at most one parent.
Is there a solution?
Thanks in advance,
Luca
[Updated on: Wed, 05 June 2013 09:13] by Moderator
|
|
|
Re: Reuse of models in a hierarchical way [message #1062037 is a reply to message #1062022] |
Wed, 05 June 2013 10:16   |
Eclipse User |
|
|
|
Luca,
Comments below.
On 05/06/2013 2:58 PM, Luca Gherardi wrote:
> Hi all,
>
> I'm defining a meta-model and a graphical editor with GFM.
>
> I have an hierarchical containment (i.e. the element package can
> contain packages).
>
> I would like to define a package and reuse it in several high-level
> packages.
What makes a package high-level verses low level?
> I would like to see the modification performed in a low-level package
> in all the models that reuse it. For this reason I though to use
> something like the load resource functionality, however I always used
> it for references, and not containments.
>
> How can I do the same with containments?
> I read about containment proxies, however I also read that it is
> possible to have at most one parent.
Yes it's possible to have cross resource containment but that doesn't
mean you can have more than one parent, so if you need more than one, it
can't be containment.
>
> Is there a solution?
Don't use containment?
You've really not spelled out the problem concretely enough for me to
say much of anything informative.
>
> Thanks in advance,
> Luca
|
|
|
Re: Reuse of models in a hierarchical way [message #1062060 is a reply to message #1062037] |
Wed, 05 June 2013 11:24   |
Eclipse User |
|
|
|
Dear Ed,
thanks for your answer.
I'll try do explain the situation better.
My main entity is a package which contains a set of modules.
You can imagine a package as a composite, which can be reused as a module.
A package contains also interfaces. In my GMF editor I want to represent a packages has a shape with attached interfaces.
For this reason I introduces the "Model" entity, which contains a package and is the root of the meta-model tree.
I would like to insert sub-packages by loading the from several files and I would like to reuse the same model in multiple files.
Ed Merks wrote on Wed, 05 June 2013 16:16Luca,
Comments below.
On 05/06/2013 2:58 PM, Luca Gherardi wrote:
> Hi all,
>
> I'm defining a meta-model and a graphical editor with GFM.
>
> I have an hierarchical containment (i.e. the element package can
> contain packages).
>
> I would like to define a package and reuse it in several high-level
> packages.
What makes a package high-level verses low level?
A high level package contains a low-level package.
Ed Merks wrote on Wed, 05 June 2013 16:16
> I would like to see the modification performed in a low-level package
> in all the models that reuse it. For this reason I though to use
> something like the load resource functionality, however I always used
> it for references, and not containments.
>
> How can I do the same with containments?
> I read about containment proxies, however I also read that it is
> possible to have at most one parent.
Yes it's possible to have cross resource containment but that doesn't
mean you can have more than one parent, so if you need more than one, it
can't be containment.
>
> Is there a solution?
Don't use containment?
I think that containment is not the right relationship, since a package is contained in another package.
Ed Merks wrote on Wed, 05 June 2013 16:16
You've really not spelled out the problem concretely enough for me to
say much of anything informative.
>
> Thanks in advance,
> Luca
|
|
|
Re: Reuse of models in a hierarchical way [message #1062062 is a reply to message #1062060] |
Wed, 05 June 2013 11:31  |
Eclipse User |
|
|
|
Luca,
Comments below.
On 05/06/2013 5:24 PM, Luca Gherardi wrote:
> Dear Ed,
>
> thanks for your answer.
>
> I'll try do explain the situation better.
>
> My main entity is a package which contains a set of modules.
> You can imagine a package as a composite, which can be reused as a
> module.
>
> A package contains also interfaces. In my GMF editor I want to
> represent a packages has a shape with attached interfaces.
> For this reason I introduces the "Model" entity, which contains a
> package and is the root of the meta-model tree.
>
> I would like to insert sub-packages by loading the from several files
> and I would like to reuse the same model in multiple files.
Then you must use a non-containment reference and it sounds like it
shouldn't be bidirectional; the thing being reused shouldn't know all
the places it's being used...
>
>
> Ed Merks wrote on Wed, 05 June 2013 16:16
>> Luca,
>>
>> Comments below.
>>
>> On 05/06/2013 2:58 PM, Luca Gherardi wrote:
>> > Hi all,
>> >
>> > I'm defining a meta-model and a graphical editor with GFM.
>> >
>> > I have an hierarchical containment (i.e. the element package can >
>> contain packages).
>> >
>> > I would like to define a package and reuse it in several high-level
>> > packages.
>>
>> What makes a package high-level verses low level?
>
>
> A high level package contains a low-level package.
>
>
> Ed Merks wrote on Wed, 05 June 2013 16:16
>> > I would like to see the modification performed in a low-level
>> package > in all the models that reuse it. For this reason I though
>> to use > something like the load resource functionality, however I
>> always used > it for references, and not containments.
>> >
>> > How can I do the same with containments?
>> > I read about containment proxies, however I also read that it is >
>> possible to have at most one parent.
>> Yes it's possible to have cross resource containment but that doesn't
>> mean you can have more than one parent, so if you need more than one,
>> it can't be containment.
>> >
>> > Is there a solution?
>> Don't use containment?
>
>
> I think that containment is not the right relationship, since a
> package is contained in another package.
>
>
> Ed Merks wrote on Wed, 05 June 2013 16:16
>> You've really not spelled out the problem concretely enough for me to
>> say much of anything informative.
>> >
>> > Thanks in advance,
>> > Luca
>
>
|
|
|
Goto Forum:
Current Time: Wed Jul 30 15:31:53 EDT 2025
Powered by FUDForum. Page generated in 0.04226 seconds
|