Hi to all
In advance: sorry for my english
Problem:
Design table that contain columns with data that is taken from database.
Using designed structure there should be possibility to create statical table - that consist of fixed number of columns and rows.
I also work with filer, so designed structure has to have the ability to file itself.
My solution for now:
Class BaseCell(abstract);
Class TextCell : BaseCell;
Class CellContainer(abstract): BaseCell;
Class Table : CellContainer;
Class Row : CellContainer;
Class Column(abstract) : CellContainer;
Class Header : CellContainer;
Class Footer : CellContainer;
Class StaticColumn : Column
Class DynamicColumn : Column
CellContainer contains array of BaseCell pointers. So i get recursive structure.
Table consist of header, footer and columns.
Columns consist of header, footer and TextCells
Header and footer can be more than one cell, it could contain several rows with several cells
I can not have multiple pointers to same object because i have to file only one object.
My question would be:
Should i declare header and footer class as containment classes or should i separate them?
Does this recursion makes sence?
Can CellContainer class know something about its child classes?
Can CellContainer child class know about "brother" (other child classes)?
Many thanx for any assistance!
In advance: sorry for my english
Problem:
Design table that contain columns with data that is taken from database.
Using designed structure there should be possibility to create statical table - that consist of fixed number of columns and rows.
I also work with filer, so designed structure has to have the ability to file itself.
My solution for now:
Class BaseCell(abstract);
Class TextCell : BaseCell;
Class CellContainer(abstract): BaseCell;
Class Table : CellContainer;
Class Row : CellContainer;
Class Column(abstract) : CellContainer;
Class Header : CellContainer;
Class Footer : CellContainer;
Class StaticColumn : Column
Class DynamicColumn : Column
CellContainer contains array of BaseCell pointers. So i get recursive structure.
Table consist of header, footer and columns.
Columns consist of header, footer and TextCells
Header and footer can be more than one cell, it could contain several rows with several cells
I can not have multiple pointers to same object because i have to file only one object.
My question would be:
Should i declare header and footer class as containment classes or should i separate them?
Does this recursion makes sence?
Can CellContainer class know something about its child classes?
Can CellContainer child class know about "brother" (other child classes)?
Many thanx for any assistance!