Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Trace model

Guys,

I didn't get a respond in the newsgroup yet, but I found a post from one of the UML guys asking about the same thing. And I'm afraid the answer he got was the same as we were expecting. EObject is no longer part of the eSuperTypes of EClasses. Ed Willing says this is "highly aligned with MOF and UML". Be that is it may, for us this means that EObject is -- unlike Java's 'Object' class -- NOT superclass of all other classes. I find that strange for two reasons: (i) EObject is allowed as reference type, and (ii) on the instance level every EMF object actually does implement EObject!!

Anyway, I think there is only one way to use EObject in the trace model. We have to manually extend the type check of links in all editors for the special case of EObjects. At least, we can be sure that on the instance level there won't be any problem because at runtime, as I mentioned already above, every generated EMF code with reflection implements EObject, even the new version of EModelElement etc.

I added an extra check for EObject reference in the diagram editor. Looks like this:

// Target type must be ok. Extra check for EObjects!!!
if (!edgeType.getEReferenceType().isSuperTypeOf(targetType) &&
     edgeType.getEReferenceType()!=EcorePackage.eINSTANCE.getEObject()) {
     return false;
}

This works. Can you plz add the same to the type check in the edit/editor code? This looks ugly but we have to live with it. At least, we can make the trace model work with that.

Ciao,
Christian


On 02/15/11 11:19, Christian Krause wrote:
Hi guys,

we were discussing at some point that we wanted to provide a generic trace model. I think this is a good time to set it up. My suggestion would be to call the plug-in org.eclipse.emf.henshin.trace. The following classes could be in the trace model:

Trace
  source: 0..* EObject (no containment)
  target: 0..* EObject (no containment)
  subTraces: 0..* Trace (containment)
  name: EString

I think we don't want any dependencies to the Henshin metamodel.

Please post comments...

Cheers,
Christian



Back to the top