I have a design question:
I want to write to a CSV file some data.
I have separate class to write data to CSV.
My problem is with the data and how to represent it:
- This data is composed of two lines of constant headers (main and secondary) and data lines that their values is changing.
- A line of headers is just a coma separated line of string values, my question is how to save these values?
For the parameter lines I created a parameters class that has a method: getLine
.
For example:
Electrical params, , , Environment params
Voltage, Current, Resistance, Temperature, Humidity
2.3, 1.2, 0.5, 25c, 84%
The empty cells are for the CSV to look good.
My questions is about the first two lines:
What is the recommended way to treat the headers?
Should I create a headers class? Two classes (One for main and one for secondary)? Other?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…