I'm creating an object hierarchy that is representing a table that is draw on a control. My hierarchy looks like this :
Table has multiple pages
Page has multiple lines
Line has multiple cells
Cell has multiple glyph
I want to have an option (a parameter) on the table to filter the column (cells) displayed. The client code can do something like this:
myTable.ShowColumns(8,12) // Will display columns 8 to 12
Displaying and placing cells on the control is the responsibility of the Lines objects.How can I pass the informations of which cells are to be displayed from the Table object to the Line object?
Should I give each line a reference to the table object? Should I try to pass the informations to each lines through the hierarchy each time Table.ShowColumns()
is called?
There must be an elegant way?