Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Herausforderungen beim Verständnis der Pattern, z.B. im GEF

(Vorschlag: Problembeschreibung, Weg, Lösung; ABER am besten überhaupt etwas.)

EditParts (see RedBook pp.103) (scratch noted down by tobias_gr)

  • the central elements in GEF applications
  • controllers that specify how model elements are mapped to visual figures and how these figures behave in different situations
  • usually create an EditPart class for every model element class
  • nearly same class hierarchy for the EditParts as you have for your model

Three different types of EditParts:

  • GraphicalEditParts: provide a graphical representation (figures) for their model
  • ConnectionEditParts: connections between (two) GraphicalEditParts, they have a source and a target EditPart
  • Connections are connected to ConnectionAnchors, which should be provided by the EditParts the ConnectionEditPart points to/comes from
  • recommended way: each GraphicalEditPart that could be a source or a target for connections implements the NodeEditPart interface
  • (we don't use: TreeEditParts, building trees of a model with SWT tree widgets)

Neccessary/important Methods to implement (as far as we know):

  • “setModel (Object)”: store your model!!!! (delegate with super, test if model is of the correct type)
  • “Object getModel”: needs not to be implementented, gives you the stored Model
  • “List getModelChildren()”: children in your hierachy (model objects), the appropriate EditParts are created by the Faytory, mostly not the connections, but the objects that should be represented as GraphicalEditParts
  • e.g. our Schema(-model) children are the roles (remark the connections are no children in view of the EditParts)
  • “IFigure createFigure()” define which figure is to be created for this EditPart (e.g. no one for our Schema, ClassFigures/MethodFigures for our roles, ConnectionFigures for the ConnectionGEParts)
  • ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection)
  • ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection)
  • ConnectionAnchor getSourceConnectionAnchor(Request request)
  • ConnectionAnchor getTargetConnectionAnchor(Request request)
  • we implement those four methods each as “return new ChopboxAnchor(getFigure());”
teaching/labs/xp/2005a/patternerfahrungen.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024