Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Mapping Model:InstanceType Name or Extending Model(Mapping JavaCode and EMF Instances)
Mapping Model:InstanceType Name or Extending Model [message #1230359] Sat, 11 January 2014 19:30 Go to next message
Sebastian Hochgatterer is currently offline Sebastian HochgattererFriend
Messages: 9
Registered: October 2013
Junior Member
Hey,

I need some advice or best pratices to map my EMF model (graphical element) with my concrete model, which contains the business-logic. The EMF Model is very generic and the user should be able to create the model with an visual editor and to extend or add the logic classes(fits an interfaces).

Graphiti helps me to create and serialize my emf model. The Editor create instances of different EClasses and connect them.
On the other hand I have a model, which consists of the logic of my model.

I read that's it common to use "instance type names" to create interfaces, and use the @generated NOT annotation to extend an existing model. But I haven't found a tutorial or an example.
How I can map my "embedded ecore model" with the "dynamic concret model" on runtime or on start up the editor?

What's the best practice to refer to an external source ressources (e.g.:jar) and should I overriding the genmodel factories?

Can anyone give me some ideas, tips or document to solve my problem?

regards s.

Re: Mapping Model:InstanceType Name or Extending Model [message #1230388 is a reply to message #1230359] Sat, 11 January 2014 21:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Sebastian,

Comments below.

On 11/01/2014 8:30 PM, Sebastian Hochgatterer wrote:
> Hey,
> I need some advice or best pratices to map my EMF model (graphical
> element) with my concrete model, which contains the business-logic.
> The EMF Model is very generic and the user should be able to create
> the model with an visual editor and to extend or add the logic
> classes(fits an interfaces).
This kind of hurts my brain...
>
> Graphiti helps me to create and serialize my emf model. The Editor
> create instances of different EClasses and connect them.
> On the other hand I have a model, which consists of the logic of my
> model.
>
> I read that's it common to use "instance type names" to create
> interfaces, and use the @generated NOT annotation to extend an
> existing model.
I have a very hard time parsing this into something meaningful. E.g.,
one specifies an instance type name on an EClass or EDataType to wrap
and existing (hand written) Java interface/class. So this is not used to
create interfaces... And "@generated not" is used to modified the
generated code of a model, not to extend it.
> But I haven't found a tutorial or an example. How I can map my
> "embedded ecore model"
Embedded in what?
> with the "dynamic concret model" on runtime or on start up the editor?
"concrete" meaning what?
>
> What's the best practice to refer to an external source ressources
> (e.g.:jar)
All references are accomplished using URIs. You can use a URI to refer
to something in a jar.
> and should I overriding the genmodel factories?
Again, hard to parse. What's a "genmodel factory"?
>
> Can anyone give me some ideas, tips or document to solve my problem?
It's really hard to figure out what your problem is exactly...
>
> regards s.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Mapping Model:InstanceType Name or Extending Model [message #1231114 is a reply to message #1230388] Mon, 13 January 2014 21:29 Go to previous messageGo to next message
Sebastian Hochgatterer is currently offline Sebastian HochgattererFriend
Messages: 9
Registered: October 2013
Junior Member
Hi Ed,
thanks for your quick reply. I try to clarify my last post.
What I want to do is mapping the EMF model to the business model. The EMF model is created via the editor. The business model is an existing Java framework created by myself. E.g. I have one element labeled EventDetector in my EMF model. Such an EventDetector element represents multiple objects on the business level, e.g. one XXEventDetector object and one EventDetectorBuffer object.
How can I connect/close the gap between my EMF model and the business model?
Is there any literature you could recommend?
Re: Mapping Model:InstanceType Name or Extending Model [message #1231228 is a reply to message #1231114] Tue, 14 January 2014 05:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Sebastian,

Comments below.

On 13/01/2014 10:29 PM, Sebastian Hochgatterer wrote:
> Hi Ed,
> thanks for your quick reply. I try to clarify my last post.
> What I want to do is mapping the EMF model to the business model. The
> EMF model is created via the editor. The business model is an existing
> Java framework created by myself. E.g. I have one element labeled
> EventDetector in my EMF model. Such an EventDetector element
> represents multiple objects on the business level, e.g. one
> XXEventDetector object and one EventDetectorBuffer object.
> How can I connect/close the gap between my EMF model and the business
> model?
How are instances of this non-EMF business model serialized/stored? How
can you access them to load them into memory?
> Is there any literature you could recommend?
It seems to me you'll need to make your business model look like an EMF
model so you can use an EReference to refer to instances of them, but
without knowing how you deal with loading instances of the hand written
model, it's hard to give advice.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Mapping Model:InstanceType Name or Extending Model [message #1231293 is a reply to message #1231228] Tue, 14 January 2014 09:32 Go to previous messageGo to next message
Sebastian Hochgatterer is currently offline Sebastian HochgattererFriend
Messages: 9
Registered: October 2013
Junior Member
Ed Merks wrote on Tue, 14 January 2014 00:27
Sebastian,

Comments below.

On 13/01/2014 10:29 PM, Sebastian Hochgatterer wrote:
> Hi Ed,
> thanks for your quick reply. I try to clarify my last post.
> What I want to do is mapping the EMF model to the business model. The
> EMF model is created via the editor. The business model is an existing
> Java framework created by myself. E.g. I have one element labeled
> EventDetector in my EMF model. Such an EventDetector element
> represents multiple objects on the business level, e.g. one
> XXEventDetector object and one EventDetectorBuffer object.
> How can I connect/close the gap between my EMF model and the business
> model?
How are instances of this non-EMF business model serialized/stored? How
can you access them to load them into memory?
> Is there any literature you could recommend?
It seems to me you'll need to make your business model look like an EMF
model so you can use an EReference to refer to instances of them, but
without knowing how you deal with loading instances of the hand written
model, it's hard to give advice.


Currently, there is no implementation for persist the non-EMF instances.
My EMF Model is serialized by XMI, so it would be the best to use the same here.

I only have a jar with the non-emf classes.

Would it be possible to discuss my problem via skype. So I have the possibility to share my screen and show you an usecase.



Re: Mapping Model:InstanceType Name or Extending Model [message #1231326 is a reply to message #1231293] Tue, 14 January 2014 11:05 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Sebastian,

Providing personalized free help via skype does not scale to the large
EMF community. It might be possible to convert instances of your hand
written implementation classes to a String and resurrect them from that
string; in that case you can wrap the class in an EDataType and do that
conversion in the factory.

On 14/01/2014 10:32 AM, Sebastian Hochgatterer wrote:
> Ed Merks wrote on Tue, 14 January 2014 00:27
>> Sebastian,
>>
>> Comments below.
>>
>> On 13/01/2014 10:29 PM, Sebastian Hochgatterer wrote:
>> > Hi Ed,
>> > thanks for your quick reply. I try to clarify my last post.
>> > What I want to do is mapping the EMF model to the business model.
>> The > EMF model is created via the editor. The business model is an
>> existing > Java framework created by myself. E.g. I have one element
>> labeled > EventDetector in my EMF model. Such an EventDetector
>> element > represents multiple objects on the business level, e.g. one
>> > XXEventDetector object and one EventDetectorBuffer object.
>> > How can I connect/close the gap between my EMF model and the
>> business > model? How are instances of this non-EMF business model
>> serialized/stored? How can you access them to load them into memory?
>> > Is there any literature you could recommend?
>> It seems to me you'll need to make your business model look like an
>> EMF model so you can use an EReference to refer to instances of them,
>> but without knowing how you deal with loading instances of the hand
>> written model, it's hard to give advice.
>
>
> Currently, there is no implementation for persist the non-EMF
> instances. My EMF Model is serialized by XMI, so it would be the best
> to use the same here.
>
> I only have a jar with the non-emf classes.
>
> Would it be possible to discuss my problem via skype. So I have the
> possibility to share my screen and show you an usecase.
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to obtain Resource URI's in-project relative path (for use in Xtext IGenerator IFileSystemAccess
Next Topic:Loading XML with multiple schemalocations
Goto Forum:
  


Current Time: Fri Apr 19 05:20:01 GMT 2024

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

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

Back to the top