Hi Stef,
On 20 Jun 2011, at 13:18, Stéphane Ducasse wrote:
I think that this is more than just having
correct/good comments....
is the parameter passed to edges: consistent? I do not think so
It is consistent. All the time the first argument sent to edges:from:to and nodes: is
meant to hold a collection of entities that will be the model behind the graph element. In
the case of nodes, there is no fancy transformation. In the case of edge, there are two
transformations. That is all.
If you find a case in which this is not true, then we need to fix that.
at least from what I understood
edges: from: to:
and
aView edges: someFamixInvocations from: #sender toAll: #candidates
show different cases.
Now if nodes: except a collection of entities playing the node role
why edges is not a collection of antities playing edges role?
It is.
Corollary why in some cases this is the case and in
other not?
Just the comments are misleading. It is always the same. Only when you have something
marked differently, you expect a different input, like edgesFromAssociations: which expect
to have a collection of associations. But those are just convenience.
Now the comments are absent and not consistent: "aCollection is the collection of
edges to represent." is it correct?
No. It's a collection of entities. The comment is bogus :)
edges: aCollection from: aFromBlock
"- aCollection is the collection of edges to represent.
- aFromBlock will be called on each element of the collection and return one edge source
each time.
Note that there is no restriction on the elements of aCollection, as long as aFromBlock
returns a node.
"
aCollection is a bad name for an argument.
I agree. It should be aCollectionOfEntities.
Same here..... even if this is a bit better because
there is one example showing that the comment is not wrong.
edges: aCollection from: aFromBlock toAll: aToBlock
"- aCollection is the collection of edges to represent.
- aFromBlock will be called on each element of the collection and return one edge source
each time.
- aToBlock will be called similarly to return a collection of destination correpsonding
to each source.
Note that there is no restriction on the elements of aCollection, as long as aFromBlock
returns a node and aToBlock returns a collection of nodes.
For example:
aView edges: someFamixInvocations from: #sender toAll: #candidates
aToBlock should return a collection, edges will be drawn from the element returned by
aFromBlock to this collection"
^self edges: aCollection from: aFromBlock toAll: aToBlock using: self edgeShape
Again, the comment needs to be fixed.
Does this clarify the situation?
Doru
Stef
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"What is more important: To be happy, or to make happy?"