Model with variable number of attributes

Hi all,

I need to render a table which is made by turning some record values into column headers, eg.




id name value

1   A    0.1

2   B    0.2

3   C    0.3

4   A    0.4

5   B    0.5

6   C    0.6



becomes




 A   B   C

0.1 0.2 0.3

0.4 0.5 0.6



It means that the model attributes will be defined by the values that are in the DB. What is the best way to create such a model? Do I need a model at all for such a task?

I understand models as those objects that work with TABLES and hold all the logic to operate with that table, so I use a ModelxTable. Sometimes, that is not needed as the info is hardcoded which then, they become constants or properties of a model or a class… whatever.

I would work with a model that gets those values on that table, and then, maybe because your question is not that clear, create objects that hold those values. Nevertheless, the way you expose the objects A,B,C for me is the same… seriously, I do not really know what you are aiming to do.

Cheers