Domanda

I am in the process of developing a GEF View (which will later be evolving into a GEF Editor), and I'm doing so with the help of the GEF Book.

In chapter 8.1 ("GEF Models") in the book, a model is constructed which mixes Domain Information and Presentation Information (which is generously admitted): GenealogyElement is the abstract superclass for the rest of the model objects (but one).

GenealogyElement takes care of the location, and location changes of its subclasses (Person, Marriage) and the like, which themselves include the actual domain information. Btw, the source code can be found on the books website.

I wouldn't mind doing so myself (even if this is probably "bad style"), but I'm using a third-party model which I cannot alter, i.e., I cannot change the class ThirdPartyNode to extend, say, ExampleElement.

One option would of course be to write my own model against the third-party one, create an abstract class ExampleElement, and let a new class ExampleNode extend both ExampleElement and ThirdPartyNode. I might end up doing so, but really want to include different possibilities first, as creating another model is a lot of typing, and potentially superfluous (isn't it?).

What are my options for seperating both information types?

Thanks in advance!

È stato utile?

Soluzione

I solved a similar problem creating a different model containing the presentation data (i.e: the position of the element) and a reference to the actual data model. You only shoud consider carefully how the data model notifies its changes to the editor.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top