Hi,
I took a look at MondrianNew.
This is an API to construct explicitly every node and edge. There is no factory for you,
at least not yet. This can be good or bad, depending on your model.
Let's take an example:
renderer := MORenderer new.
node1 := renderer node on: 'hello'.
node2 := renderer node on: 'world'.
edge := renderer edge from: node1 to: node2.
Here you are explicitly remembering the node references and you are passing them to the
edge creation. When you have a handful of these nodes, this can fit nicely what you want.
As soon as you have a multitude of nodes, it is no longer easy to make the mapping,
because you will have to manage the references manually.
In MOViewRenderer we have API that helps you lookup and match nodes only in terms of your
model (basically you never get to manipulate nodes or edges, unless you really really want
to). The idea behind this is that you should only think in terms of your model and never
get to manipulate the internals of Mondrian. This works in many cases, but you do not have
such a convenient way to work with explicit nodes and edges like above.
So, maybe a good thing would be to add finally some edgeFromNode:toNode: that provides a
creation of a node without any node lookup. So, you could have:
view := MOViewRenderer new.
node1 := view node: 'hello'.
node2 := view node: 'world'.
edge := view edgeFromNode: node1 toNode: node2.
What do you think?
Cheers,
Doru
On 20 Jun 2011, at 15:03, Alexandre Bergel wrote:
The package MondrianNew in the squeaksource repository
of Mondrian contains a bunch of classes we quickly defined:
MORenderer>>
addEdge:
addEdges:
addNode:
addNodes:
MOEdgeFactory>>
from:to:
MONodeFactory>>
on:
Cheers,
Alexandre
--
www.tudorgirba.com
"If you interrupt the barber while he is cutting your hair,
you will end up with a messy haircut."