Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Reusing Ecore (M3) as extensible Kernel Metamodel (M2)
Reusing Ecore (M3) as extensible Kernel Metamodel (M2) [message #544007] Thu, 01 July 2010 10:37 Go to next message
Luca Berardinelli is currently offline Luca BerardinelliFriend
Messages: 54
Registered: June 2010
Location: Vienna
Member
Dear all,
I'm going to reuse Ecore (the metametamodel, M3) as a kernel metamodel (M2) for a family of related DSLs.
I investigated the use of the Core package described in the UML infrastructure: I realized that it could be not useful to build the whole Core package from scratch: in fact you have to take care of package dependencies if you split your metamodel in packages (as Core does in the UML Infrastructure).

Therefore I decided to reuse Ecore at level M2 (i.e. as my core/kernel metamodel) and extend it. I point out that for extension I mean "subclassing" the existing metaclasses of my new core/kernel rather modifying anything inside the core.

In order to avoid word clashes, I just renamed the metaclasses of this Ecore-based core/kernel: I substitute the "E" prefix with a "C" one for each metaclass.

I would like to know if there are some useful tricks for "reusing" Ecore. For example I don't know which of the following intuitions are the good, the bad and the ugly Smile :

1. renaming reused E<metametaclasses> in C<metaclasses>;

2. removing reflection: EObject with its attributes and operations should not be inherited from Ecore. The reflection is modeled at level M3 in Ecore to be provided at level M2. The reflection at level M2 is provided by Java that is used to implement the metamodel (right?). Do you know how to refactor the relationships from/to EObject once the CObject counterpart is deleted (i.e. not reused on in the new core/kernel)?;

3. extend only the core/kernel C<metaclasses> that I intend to use in my models at level M1. Do I need to make all the C<metaclasses> abstract?

Please, share your tricks and suggestions to resue at best Ecore as core/kernel metamodel.

Thanks.


Luca Berardinelli

[Updated on: Thu, 01 July 2010 10:40]

Report message to a moderator

Re: Reusing Ecore (M3) as extensible Kernel Metamodel (M2) [message #544061 is a reply to message #544007] Thu, 01 July 2010 13:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Luca,

Comments below.

Luca Berardinelli wrote:
> Dear all,
> I'm going to reuse Ecore (the metametamodel, M3) as a kernel
> metamodel (M2) for a family of related DSLs.
> I investigated the use of the Core package described in the UML
> infrastructure: I realized that it could be not useful to build the
> whole Core package from scratch: in fact you have to take care of
> package dependencies if you split your metamodel in packages (as Core
> does in the UML Infrastructure).
>
> Therefore I decided to reuse Ecore at level M2 (i.e. as my core/kernel
> metamodel) and extend it. I point out that for extension I mean
> "subclassing" the existing metaclasses of my new core/kernel rather
> modifying anything inside the core.
>
> In order to avoid word clashes, I just renamed the metaclasses of this
> Ecore-based core/kernel: I substitute the "E" prefix with a "C" one
> for each metaclass.
>
> I would like to know if there are some useful tricks for "reusing"
> Ecore. For example I don't which of following intuitions are good, the
> bad and the ugly :) :
>
> 1. renaming E<metaclasses> in C<metaclasses>;
Renaming isn't extension.
>
> 2. removing reflection: EObject with its attributes and operations
> should not be inherited from Ecore.
Pretend it's not there.
> The reflection is modeled at level M3 in Ecore to be provided at level
> M2. The reflection at level M2 is provided by Java that is used to
> implement the metamodel (right?). Do you know how to refactor the
> relationships from/to EObject once the CObject counterpart is deleted
> (i.e. not reused on in the new core/kernel);
No.
>
> 3. extend only the core/kernel C<metaclasses> that I intend to use in
> my models at level M1.
Do you real mean "in" your models at M1 level or for your models at m1
level.
> Do I need to make all the C<metaclasses> abstract?
There's never an absolute need to make something abstract. You only do
that to prevent instances from being created.
>
> Please, share your tricks and suggestions to resue at best Ecore as
> core/kernel metamodel.
Just use it directly. Anything else you need that's not there, use
EAnnotations. If the EAnnotation.details map isn't enough, model more
complex things and contain them under EAnnontation.contents. If Ecore
has things you must remove, then you don't really want Ecore; start from
scratch.
>
> Thanks.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:XSD to Ecore to XSD
Next Topic:How to read an Ecore model
Goto Forum:
  


Current Time: Tue Sep 24 18:30:35 GMT 2024

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

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

Back to the top