Interface Container.Hierarchical

Hi,

i like to implement Container.Hierarchical. I wont understand why the interface makes the Tree look flat and why the method Container.Hierarchical#getChildren(…) must return the IDs of the children for an item but not the children themself. Isnt it easier to work with if getChildren returns the children? May its nice if you have all the tree items in one fat list but i think it is getting uncomfortable to manage a “real” tree this way.
But what i am really annoyed about is the use of method and parameter names. Again getChildren for example. Hey if the method is called getChildren i expect that this thing have to return the children and not the IDs of the children as mentioned in the javadoc. Maybe cleaning up the interfaces could be a nice thing for a next version. Anyway, we have still good fun with vaadin.

Greets
Stefan

If you have huge trees or huge nodes, working with the IDs can let you avoid loading very large amounts of data unnecessarily.

As for the naming, I agree it is suboptimal - not only here but also in many other contexts related to the data model, method naming does not give many clues about when you should use an ID and when the real object. However, changing method names would impact a large number of users. Maybe we could deprecate some of the old methods and provide alternatives, but this would pollute the interfaces with many unused, “have to implement” methods - we could consider this for Vaadin 7, but it might not happen. Changing the parameter names (if they are not good), on the other hand, could be done safely and easily.

Ok, i understand that.

Good to see that other framework developers have the same issues like me. :slight_smile: I know that feeling when
realising that an Interface should be different somehow. But youre right, polluting the Interfaces is no good choice.
Better keep it small.

Cheers
Stefan