views:

21

answers:

1

I need to store Brush/Pen information about several shapes in a database table, one row for each layer I draw.

I was thinking of two schemes:

BRUSH_INFO                 PEN_INFO
SolidBrush(Color.Red)      Pen(Color.Black)

pros: only two colums
cons: eval'd column

BRUSH_INFO   PARAM_B1   PARAM_B2 ... PEN_INFO  PARAM_P1     PARAM_P2 ...
SolidBrush   Color.Red  (null)       Pen       Color.Black  (null)        

pros: parameters are separated
cons: many columns

I think the second one should be generic enough but I'm not sure.

What schema will you use to store this kind of information?
Can you suggest a table structure so that I can store any kind of Brush/Pen with its parameters?

A: 

I would use seperate tables for brush and pen information. So you could reuse the same brush/pen for multiple shapes.

Ben
Since there will be like 10 layers I don't really care about duplication: my question aws about the structure itself (one, or many columns)
Keeper
Ok. I would go with your second approach. Seperate Information should go in separate column
Ben
As you're the only anwser and I did it this way I'll mark your answer accepted :P
Keeper