Someone asked me this, what will be a good aproach?
Design a model of a spreadsheet (like excel), but don’t be afraid, do it very simple!
We only need a basic class diagram with no more than 5 or 6 classes.
It should have the following features:
The sheet will only manage numeric data
There will be two types of cells:
- Cells that contain a fix number
Cells that contain a formula
The formulas are very straightforward; just support two types of operations: subtraction and addition of two cells. Eg: Cell A + Cell B; Cell A - Cell B;
Don't worry about parsing or managing the formulas as text, just suppose that you will have the three parameters separately (the operation and the two referenced cells).
The spreadsheet will only contain one column.
Don't worry about the graphic interface or user interactions. JUST DO THE DIAGRAM OF THE BASIC MODEL.
One possible idea is to have an element call SpreadSheet that contains a collection of Cells and the operations to set and get cells values. If you find a better approach, use it!
So far i think on adding this classes: SpreadSheet, Column, FormulaCell and NumericCell. I also will add a ICell interface. Is this a good approach? I trying to figure out the methods and properties of each classes, can someone help a newbie?