Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336707

Summary: Modify GMF Notation metamodel to not depend on Ecore
Product: [Modeling] GMF-Runtime Reporter: Mariot Chauvin <mariot.chauvin>
Component: NotationAssignee: Mariot Chauvin <mariot.chauvin>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: ahunter.eclipse, apupier, martin.fluegge, mistria, stephane.fournier, stepper
Version: 2.1Flags: mariot.chauvin: indigo+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 336706    
Attachments:
Description Flags
Patch version 0.1
none
Patch version 0.2
mariot.chauvin: review?
a fragment for org.eclipse.gmf.runtime.notation bundle none

Description Mariot Chauvin CLA 2011-02-09 08:12:09 EST
We could modify the GMF Notation metamodel to not depend on Ecore.
We could do this and keep the compatibility with previous diagram files versions by copying the EAnnotation EMF implementation and keeping the eAnnotations feature name.
Comment 1 Anthony Hunter CLA 2011-02-17 11:10:50 EST
Is this a refactoring that would affect any API?
Comment 2 Mariot Chauvin CLA 2011-02-17 11:31:33 EST
(In reply to comment #1)
> Is this a refactoring that would affect any API?

Our goal is to not break any API. However I currently see one API break linked to the dependency removal. The fact that instances of org.eclipse.gmf.runtime.notation.View will no more instances of org.eclipse.emf.ecore.EModelElement but instances of org.eclipse.gmf.runtime.EModelElement. 

We only start to work on it, so other issues may come.

Do you think already this API break could be problematic ?

In this case, we will start to think on another way to provide a notation metamodel which does not depend on ecore (a new notation plugin ?).
Comment 3 Anthony Hunter CLA 2011-02-17 11:46:50 EST
You will be able to turn on API tools against GMF Notation 1.4.2 to see if any errors come up.
Comment 4 Mariot Chauvin CLA 2011-02-22 05:50:32 EST
Created attachment 189467 [details]
Patch version 0.1

Anthony,

Please find a first patch to review which removes the dependency from ecore without breaking any dependency.

I tested it successfully with the ecore tools modeler, being able to reload existing diagrams and create new one, without problems.

Thanks,

Mariot.
Comment 5 Anthony Hunter CLA 2011-02-22 10:52:56 EST
I am seeing new code under the org.eclipse.emf.ecore package. Can you confirm that is what you wanted?

We cannot add packages belonging to the EMF namespace to GMF Notation.
Comment 6 Mariot Chauvin CLA 2011-02-22 11:16:53 EST
(In reply to comment #5)
> I am seeing new code under the org.eclipse.emf.ecore package. Can you confirm
> that is what you wanted?

Yes this is what I wanted.
We added an EPackage to the notation metamodel an specify "org.eclipse.emf.ecore" as package name in the genmodel. This is the trick we use to not break the compatibility with previous versions.

> We cannot add packages belonging to the EMF namespace to GMF Notation.

Why ? I understand that it's mostly strongly discouraged to avoid confusion but in this case, it's only there to keep source and binary compatibility.

BTW I do not find such a requirement in http://eclipse.org/indigo/planning/EclipseSimultaneousRelease.php but I may miss something.
Comment 7 Mariot Chauvin CLA 2011-03-01 07:30:22 EST
(In reply to comment #6)
> (In reply to comment #5)
> > I am seeing new code under the org.eclipse.emf.ecore package. Can you confirm
> > that is what you wanted?
> 
> Yes this is what I wanted.
> We added an EPackage to the notation metamodel an specify
> "org.eclipse.emf.ecore" as package name in the genmodel. This is the trick we
> use to not break the compatibility with previous versions.
> 
> > We cannot add packages belonging to the EMF namespace to GMF Notation.
> 
> Why ? I understand that it's mostly strongly discouraged to avoid confusion but
> in this case, it's only there to keep source and binary compatibility.
> 
> BTW I do not find such a requirement in
> http://eclipse.org/indigo/planning/EclipseSimultaneousRelease.php but I may
> miss something.

Ok we will try to provide another approach (with fragments) to not directly modify the gmf runtime notation. Stay tuned :)
Comment 8 Mariot Chauvin CLA 2011-03-01 13:38:30 EST
Created attachment 190071 [details]
Patch version 0.2
Comment 9 Mariot Chauvin CLA 2011-03-01 13:40:02 EST
Created attachment 190072 [details]
a fragment for org.eclipse.gmf.runtime.notation bundle
Comment 10 Mariot Chauvin CLA 2011-03-01 13:51:41 EST
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > I am seeing new code under the org.eclipse.emf.ecore package. Can you confirm
> > > that is what you wanted?
> > 
> > Yes this is what I wanted.
> > We added an EPackage to the notation metamodel an specify
> > "org.eclipse.emf.ecore" as package name in the genmodel. This is the trick we
> > use to not break the compatibility with previous versions.
> > 
> > > We cannot add packages belonging to the EMF namespace to GMF Notation.
> > 
> > Why ? I understand that it's mostly strongly discouraged to avoid confusion but
> > in this case, it's only there to keep source and binary compatibility.
> > 
> > BTW I do not find such a requirement in
> > http://eclipse.org/indigo/planning/EclipseSimultaneousRelease.php but I may
> > miss something.
> 
> Ok we will try to provide another approach (with fragments) to not directly
> modify the gmf runtime notation. Stay tuned :)

Please find attached a minimal patch for org.eclipse.gmf.runtime.notation. The patch enables one to use fragment, it only modifies Manifest.MF file. The fragment we provide as second attachment removes the dependency from Ecore metamodel without breaking any API.

Anthony what do you think of this ?

- No API break, neither source nor binary
- No org.eclipse.gmf.runtime.notation direct modifications or new packages.
- CDO native possible, by simply install the fragment.

I think it's quite fair.
Comment 11 Anthony Hunter CLA 2011-03-09 11:44:54 EST
We are just changing org.eclipse.gmf.runtime.notation via the patch and that is it?
Comment 12 Mariot Chauvin CLA 2011-03-09 13:26:08 EST
(In reply to comment #11)
> We are just changing org.eclipse.gmf.runtime.notation via the patch and that is
> it?

Yep. The patch simply enables one to use fragment with org.eclipse.gmf.runtime.notation as bundle-host. 

The fragment we provide as other attachment, use org.eclipse.gmf.runtime.notation as bundle-host and acts as a bridge to provide EModelElement and EAnnotation implementation not dependant from the EMF one.
Comment 13 Anthony Hunter CLA 2011-03-09 15:45:01 EST
I have committed the change, a build should run overnight so you can test.
Comment 14 Eike Stepper CLA 2011-04-10 23:55:17 EDT
Hi Mariot,

This sounds very interesting! Could you already verify that the recent GMF builds have this ability? Is the fragment included there?

For CDO this would be extremely helpful because our users could regenerate their notation model for native usage within CDO, if the odd Ecore dependency was finally gone ;-)
Comment 15 Mariot Chauvin CLA 2011-04-21 07:06:46 EDT
(In reply to comment #14)
> Hi Mariot,
> 
> This sounds very interesting! Could you already verify that the recent GMF
> builds have this ability? Is the fragment included there?
> 
> For CDO this would be extremely helpful because our users could regenerate
> their notation model for native usage within CDO, if the odd Ecore dependency
> was finally gone ;-)

Hi Eike,

Sorry for the lag of my response. No I did not test yest that the recent GMF builds have the patch applied, and that the mechanism of fragment we use, work as we expect but I will did it quite soon.

The fragment is not yet hosted on GMF CVS, I created an eclipselabs project to work in a collaborative way on this subject :

http://code.google.com/a/eclipselabs.org/p/cdo-gmf-notation/

The ecore dependency removal was the first step, we are now working on GMF Notation implementation based on CDO, and we have some code :). See bug 336709 comment 1
Comment 16 Eike Stepper CLA 2011-04-21 07:46:47 EDT
Thanks for the hint, Mariot! 

Et Joyeux Pâques ;-)
Comment 17 Pierre-Charles David CLA 2022-12-28 10:04:41 EST
Eclipse GMF Notation is moving away from this bugs.eclipse.org issue tracker to
https://github.com/eclipse/gmf-notation.

If this issue is relevant to you and still present in the latest release:

* Create a new issue at https://github.com/eclipse/gmf-notation/issues/.
  * Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  * In the GitHub description, start with a link to this bugzilla ticket
  * Optionally add new content to the description if it can helps towards resolution
* Update bugzilla ticket
  * Add to "See also" property (up right column) the link to the newly created GitHub issue
  * Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  * Set status as CLOSED MOVED

All issues that remain open will be automatically closed in the next few weeks. Then
the Bugzilla component for GMF Notation will be archived and made read-only.
Comment 18 Pierre-Charles David CLA 2023-02-05 11:15:37 EST
Closing as part of the move to GitHub.
Feel free to re-open an equivalent issue at https://github.com/eclipse/gmf-notation/issues if you feel this is still relevant.