|Extend / Inherit Diagrams [message #682206]
||Fri, 10 June 2011 16:01
| Erik Englund
Registered: July 2009
I have a set of diagrams.|
Currently two diagrams basically re-implement all the same code because there is one common base emf model to both of the specific semantic models.
I would like to be able to create a base diagram implementation that the other specific implementations can inherit from and customize. This would reduce duplicate code and all the other problems that go with it.
My first approach was to create a base diagram using the gmf tools. This seemed to work although my base model doesn't have a true root object so this didn't work so well. It would be nice if I could define no root nodes within the gmfmap at the top level.
Anyway, I was able to get around some of that and at least create some of the base diagram items in a base diagram model by selecting a item in my model which does contain some of the common classes.
Then I went to reuse these nodes in the other tooling definitions. This is where I REALLY ran into problems. My naive approach was to first load the GMFMAP of the base models using load resource within the specific gmfmap and reference the base nodes from within the specific model. This seemed to work and I was even able to generate the gmfgen and generate code. However, I ran into two BIG problems.
1.) It still generated new implementations of ALL the base edit parts etc. It doesn't even extend or reference them. I don't want these. The whole point is to reuse the base edit parts classes. This is VERY annoying.
2.) The tools for the base items get generated in a "mis-referenced" tools group. Also very annoying. I want them to show up how I defined them in the base model.
I also noted some other problems. The visual IDs all don't match. This to me would seem to be a problem.
Am I going about this all wrong?
Powered by FUDForum
. Page generated in 0.02695 seconds