[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: GEF, EMF and semantic vs. graphical model

On 2004-11-30 17:53:59 +0100, "Randy Hudson" <none@xxxxxxxxxx> said:

I've followed some of the threads concerning GEF and EMF integration.
I'm glad that other people have the same problems with two
implementations of the Command pattern and other things (e.g. the
naming problem with ConnectionEditPart.getTarget() and
Adapter.getTarget()).

You should ask why getTarget is on Adapter. Adapter is the interface used *by* the TARGET. Surely the target already knows about itself. If a specific adapter needs to allow clients to reach in to the EMF object, that adapter should provide the unwrap() method on the interface which the adapter is exposing to clients (the actual interface being adapted).

I didn't want to start a discussion about the adapter pattern here :) I've already posted a message in the EMF newsgroup
(Pattern trouble: Adapter, Observer, Extension Object, Date: Mon, 18 Oct 2004) where I tried to understand the EMF implementation of the adapter pattern. IMHO Adapter.getTarget() should be called Adapter.getSubject() (using the observer pattern role name) or Adapter.getAdaptee() (using the adapter pattern role name). I also think that the Adapter interface should be splitted into two interfaces, a NotifierListener (or something) and the Adapter interface. But I don't think that this interface is going to be refactored, is it?

PS: Is it called "semantical model" or "semantic model".. (or graphical
vs. graphic model)? Too many problems everywhere %-)

I use the terms "business model" and "view model" . "semantic model" is the same as business, but it take me longer to process that term in my head :-P

OK. Since I'm not a native speaker, it makes not difference to me using "semantic", "domain" or "business" :)
Do you know any works (atricles, patterns) on combining business and view model?


Maybe it would be a nice idea of creating a, maybe EMF/UMLDI based, layer (or framework) handling the view model. Using some kind of mapping mechanism this layer could be connected to the business model and the EditParts. I'm wondering if it's possible to move all view model related stuff into this framework and provide some super classes, e.g. ConstraintChange commands for moving the GraphNodes around.

Jens