(Dolphin 4)
TreeModel>>nodeClass
^TreeNode
Since the above method has been added to TreeModel to answer the node class,
shouldn't it be used everywhere? TreeNode is hardcoded in
TreeModel>>initialize rather than using the #nodeClass method. Elsewhere,
the method is sent instead of hardcoding the class. Perhaps there is some
reason to hardcode the anchor node but not other nodes?
TreeModel>>initialize
...
anchorNode := TreeNode new.
(versus)
anchorNode := self nodeClass new.
By changing #initialize to use the second form, a subclass of TreeModel
could use a different node class without needing to override #initialize
(just by overriding #nodeClass), for example, I'm using SortedTreeNode so a
node can keep its children sorted.
What do you think?
-- Frank
[hidden email]