Hi,
On 20 Apr 2010, at 09:08, Lukas Renggli wrote:
Very cool indeed, I can use that.
What do I do if I have different kinds of objects per level?
You have to take care of that somehow in the children block. The
level
option is one possibility to distinguish between objects. Another
one is a
"isKindOf:", but that you can do yourself.
Aha, ok. I was quickly looking at the code but couldn't figure out how
the specification of the different selectors at different levels
worked :-)
It would be interesting to offer
other means of mapping (maybe something that builds a map behind
the scene),
but I would not know how to do that. If you have ideas, I would be
happy to
hear them :).
I was thinking/expecting more something along a meta-model for trees.
For now I guess the current implementation is fine, I just need to
implement some unique selector in all the objects that will be part of
the tree that returns their children.
Yes, when you have distinct types you can just either dispatch to
them, or use an isKindOf: as a shortcut. The problem comes when you do
not have distinct types (for various strange reasons) but you still
want to treat the objects differently.
What do you mean by a meta-model for trees? This is what the children:
block does. What else would you like?
Cheers,
Doru
Lukas
--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"There are no old things, there are only old ways of looking at them."