Hi Alex,
One strong principle in Mondrian is to have graph
elements independent of their representation. A graph element being just a wrapper of the
domain object. This is what has been enforced in the VW and Pharo versions.
However, this has not been completely nice and clean. For example, MOGraphElement defines
#bounds, #absoluteBounds. MONode defines #translatedBy:. Shall these methods be moved into
the shape?
I disagree that this is a problem. The Element has a physical location and dimension, the
Shape is responsible for retrieving the actual values from the model.
Currently, we have the following responsibilities:
a graph element:
- keeping a ref to its shape
This is not a responsibility, it's a collaboration
- managing caches
This is internal implementation. This could probably be moved indeed.
- managing attributes
- managing nesting of nodes and edges
- layout
It is responsible for the positioning, but this is achieved through a collaboration
- supporting announcement
This is again a collaboration, because the interaction responsibility is handled by the
announcer.
a node:
- keeping a location
- maintaining a zordered-list of elements to display
- dedicated caches (e.g., bitmap)
This is internal implementation, but it could probably be pushed externally somewhere.
- rendering on a canvas
Not quite correct. The actual rendering is taken care of by the shape.
> an edge:
> - target and source node
- rendering on a canvas
Not quite correct. The actual rendering is taken care of by the shape.
a root:
- selection box
I think this could go to the Canvas.
- another event management
I am not sure what this is.
Clearly, some responsibilities are ill located. I will
do soon some cleaning...
I think there are some places for refactoring, but not that many as it might sound from
your mail. One thing that you might need to know is that we used to have an explicit Graph
entity. However, we ended up merging it in the Element because of scalability issues (less
objects). Perhaps the situation is different now, but we nevertheless should take care of
this aspect, too.
Cheers,
Doru
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Some battles are better lost than fought."