I am storing graphical objects in SQL Server.
A Line, Rectangle, Ellipse, Image and Text object can all be represented spatially on the drawing surface by 2 elements StartPoint and EndPoint (Point= X INT > 0,Y INT > 0). Without type support , it decomposes to the columns X,Y,Xi,Yi.
I had a lot of fun with the the front end (C# windows forms) class structures (nice little factory pattern) and decided to add a free hand drawing object.
The front end coding was fairly trivial. Every 20ms, get the mouse coordinate (Point: X,Y). After this object is “finished”, I am left with an array of Points. On average about 100 points per free hand object are generated (2 seconds of mouse down).
So....... Should I tell 1NF to go jump and store a long string? “12,45:23,56:“ or be a good DBA and store a point per row?
This object is not business critical, so I might not have to store the object but I am preparing for the worst.
| posted on Sunday, February 06, 2005 6:53 AM