Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Component hierarchy persistence
Component hierarchy persistence [message #430765] Mon, 08 June 2009 15:11 Go to next message
Tobias Neef is currently offline Tobias NeefFriend
Messages: 17
Registered: July 2009
Junior Member
Hello,

a college of mine has the following problem. I would be great if you could
help her:

Say you have this ecore model structure

|--RTContainer
|--RTComponent1
|--RTComponent10
|--RTComponent11
|--RTInsance110
|--RTComponent111
|--RTComponent12
|--RTInstance13
|--RtInstance14
|--RTInstance2
|--RTComponent3

RTAbstractComponent is an Abstract super class
RTComponent is a subclass of RTAbstractComponent and can contains other
RTCompoments or RTInstances
RTInstance is subclass of RTAbstractComponent and is the last element in
the hierarchy
RTContainer is the top level element and contains all kind of
RTAbstractComponent
In emf ecore, RTAbstractComponents are contained in RTContainer
and RTAbstractComponents are also container in the RTComponent.
I am trying to created the structure above.
I create all RTInstance add them to their RTComponent or RTContainer.
In debug mode the structure look correct as displayed above, but as soon
as the model is serialized
the structure is totally destroyed and look like this

|--RTContainer
|--RTComponent1
|--RTComponent10
|--RTComponent11
|--RTInsance110
|--RTComponent111
|--RTComponent12
|--RTInstance13
|--RtInstance14
|--RTInstance2
|--RTComponent3

Anyone knows why EMF is destroying the containment hierarchy, this should
be a a simple case. It looks fine until the model is serialized.
a simple analogy (not the best) would be a family with people and pets,
people and pets are all animal (scientifically).
People give birth to people and they can one one to many pets...
Please let me know if you have any questions.
Re: Component hierarchy persistence [message #430766 is a reply to message #430765] Mon, 08 June 2009 15:19 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Tobias,

Comments below.

Tobias Neef wrote:
> Hello,
>
> a college of mine has the following problem. I would be great if you
> could help her:
>
> Say you have this ecore model structure
>
> |--RTContainer
> |--RTComponent1
> |--RTComponent10
> |--RTComponent11
> |--RTInsance110
> |--RTComponent111
> |--RTComponent12
> |--RTInstance13
> |--RtInstance14
> |--RTInstance2
> |--RTComponent3
>
> RTAbstractComponent is an Abstract super class
> RTComponent is a subclass of RTAbstractComponent and can contains
> other RTCompoments or RTInstances RTInstance is subclass of
> RTAbstractComponent and is the last element in the hierarchy
> RTContainer is the top level element and contains all kind of
> RTAbstractComponent
> In emf ecore, RTAbstractComponents are contained in RTContainer
> and RTAbstractComponents are also container in the RTComponent.
> I am trying to created the structure above.
> I create all RTInstance add them to their RTComponent or RTContainer.
> In debug mode the structure look correct as displayed above, but as
> soon as the model is serialized
> the structure is totally destroyed and look like this
>
> |--RTContainer
> |--RTComponent1
> |--RTComponent10
> |--RTComponent11
> |--RTInsance110
> |--RTComponent111
> |--RTComponent12
> |--RTInstance13
> |--RtInstance14
> |--RTInstance2
> |--RTComponent3
> Anyone knows why EMF is destroying the containment hierarchy, this
> should be a a simple case. It looks fine until the model is serialized.
I can't even imagine how such a thing would happen. Certainly that's
impossible given just purely generated EMF code.
> a simple analogy (not the best) would be a family with people and
> pets, people and pets are all animal (scientifically).
> People give birth to people and they can one one to many pets...
> Please let me know if you have any questions.
Add an adapter to RTContainer and monitor all the notifications to
figure out if some bit of code you've written is moving things around...


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problem with Persistence
Next Topic:[QUERY] Textual syntax for EMF Query?
Goto Forum:
  


Current Time: Fri Apr 19 04:58:23 GMT 2024

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

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

Back to the top