0

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?

Keeper
  • 3,516
  • 1
  • 18
  • 29

2 Answers2

0

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

Ben
  • 2,560
  • 4
  • 29
  • 43
  • 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 Sep 14 '10 at 08:06
  • Ok. I would go with your second approach. Seperate Information should go in separate column – Ben Sep 14 '10 at 08:09
0

Store them as XML Serialized data, no tables needed.

serhio
  • 28,010
  • 62
  • 221
  • 374