Hi all
In the project Eclipse JWT, we manage workflows using ecore-specified
XMI models and we want to let our users define and add custom
information in it.
We've logically though about allowing to define ecore metamodels than
extend ours, and about the possibilities of Dynamic EMF. So we've tried
a few things (using Europa's EMF) and come across what seem to be
limitations of extending EMF, especially concerning typing of relations :
* a dynamic class can only extend a non-interface, non-abstract
static class. OK, actually I can agree with this one ;)
* in order to create dynamic extensions inheriting from this
non-interface, non-abstract static class, I've had to create and
register a custom factory that does this work for the package containing
the dynamic ecore extension. Well, ok again, we could automatically do
this for all ecores that are found in a given place.
* Now to the fun stuff : I defined in a dynamic EMF extension to my
core, static metamodel a containment eReference that whose target type
is a core, static type, but any sample model fails to load. It appears
that proxy resolution fails for my eReference at parsing : it goes
through XMLHandler.setFeatureValue()'s proxy handling code at line 2628
where either createObjectFromFeatureType() believes the eReference's
eType is eClassifier (because it is the type of the "eType" feature of
EReference), or createObjectFromTypeName() believes the eReference's
eType is PropertyImpl (whereas it should be a ClassImpl with name
Property).
* and upside down, I defined a core, static-typed element under a
dynamic defined, but was not able to load a sample following this model,
for the same reason. Though proxy resolution works fine for attributes,
or if typing the dynamic-defined relation with a dynamic-defined
extension of a core, static type.
Any feedback about this behaviour ?
NB. for those more interested about the "requirements" side of our
endeavours, you can look here see more here
http://wiki.eclipse.org/JWT_Metamodel .
Regards,
Marc Dutoo
Open Wide
Eclipse JWT co-lead