We have a fairly expressive object model with a variety of inheritance trees of various depths. I’m concerned that SmartGWT’s DataSource interface has no ability to expose such variety to the user interface like many Server Side Java based UI frameworks do (eg., Echo, Wicket etc.,)
For example if I have a ListGrid and the objects displayed in each row can vary according to their class (all being derived from a single base class eg., Account), is it possible to have different “rows” in the list grid rendered differently according to the type of Object (ie., class) that each row represents?
Or is it best not to use inheritance in our data models and just keep all class hierarchies flat? (which, I realize, wouldn’t be very OO at all really)
SmartGWT has very strong support for object models that use inheritance (see eg DataSource.inheritsFrom), the question comes down to what you want displayed.
In a ListGrid, all displayed objects have common columns - that’s not a limitation of SmartGWT, that’s just how grid controls always look.
If there are minor variations in how each row is displayed, use a CellFormatter to pick different properties from different objects to display in a single common column.
If there are major variations in how each row is displayed, it’s more typical to pick from eg a TreeGrid component that is showing only titles, then display related records (of a uniform type with uniform columns) in an adjacent ListGrid or DetailViewer control.