Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] Checking my understanding

Your assumptions are all (mostly) correct. Normally you'd be told that this isn't an implementation discussion, but the mailing-list is pretty quiet so far.

2 - There is no strict correlation between model and edit part, although 1-to-1 is very common. 1-to-2 (2 model objects) is also common, where the model is split into a business model and a diagram model, with the diagram knowing about the business model, but not vice-versa. Sometimes objects exist only in the business model (like an attribute), and some exist only in the diagram model (like a note/comment). Typically an EditPart has a primary model object with which it will register itself. Mapping model to EditPart is done so one EditPart can find another, using the Model as the key (Connections, for example).

2.5 - You didn't ask, but the same goes for EditPart and "visuals", such as a Figure. 1-to-1 is common, but not enforced. There is a separate registry mapping visual to EditPart, which is used for hit-testing/targeting.

3 - If you have any specific questions about EditPolicies, please ask on the newsgroup. For example, Delete is somewhat complex now. We will be simplifying this since the current complexities don't really solve the hard cases. Basically, we will still forward the delete of a part to its parent (ComponentEditPolicy.getDeleteCommand() does this), but we will not "broadcast" the delete to the whole world, a.k.a. connections and children (NodeEditPolicy and ContainerEditPolicy exist in part for this purpose). Instead, it will be up to the application to create the proper command, using its own form of delegation if necessary. As a result we might get rid of a few policy types.

"Pierre Boudreau" <pier@xxxxxxxxxxx>




          "Pierre Boudreau" <pier@xxxxxxxxxxx>
          Sent by: gef-dev-admin@xxxxxxxxxxx

          06/11/2002 09:36 PM
          Please respond to gef-dev



To: <gef-dev@xxxxxxxxxxx>
cc:
Subject: [gef-dev] Checking my understanding


Hello.  I am prety new to Eclipse and GEF and I am thinking of adapting a
specialized GUI editor I was working on to integrate with Eclipse through
GEF.  I would just like to check my understanding of the framework and make
sure I am moving in the right direction before I go too far.  Here is a list
of statements that sum up what I understand about the design and the
intended implementation of a GEF plugin:

1 -The objects in the model should know nothing about edit parts or figures.
2 -Every type of object in the model should have a corresponding edit part.

Model:                                                        Edit parts:
   Drawing
DrawingEditPart
      /       \                                                        /
\
Square    Circle                                SquareEdirPart
CircleEditPart


3 -Edit parts know how to draw themselves in a view (through draw2d
figures).
4 -Policies can be seen as shrink wrapped behaviors that can be added to
edit parts to make them behave in a certain way (not too sure I get this
one...).
5 -The model shoudl implement a command process pattern as its only entry
point for the view to manipulate it.
6 -The model should notify the view of changes through a callbacks to an
observer interface.

I would much apreciate if someone could confirm these points with a simple
correct/incorrect response for each item.

I also plan to make a few collaboration and sequence diagrams to get a
better understanding of the tpical patterns involved in developping a GEF
plugin.  Does anybody have something like this already?

Thanks with your patience with my newbie questions.

Hope I am posting this to the right list...

Pierre Boudreau
Alpha Centauri Inc.

_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/gef-dev

GIF image

GIF image


Back to the top