Design question: collections

Design question: collections

Old forum URL: forums.lhotka.net/forums/t/6225.aspx


esteban404 posted on Wednesday, January 21, 2009

I can only ask this about some data I'm going to be managing, so forgive the anti-OO behavior...

I have multiple specific objects all saving their data into one big honking table (a denormalized reporting table). If I construct a collection object for all of it, is it feasible to then filter it for a grid view in a Win UI?

For example, if the users need to add or edit, the filter would be used to indicate the corresponding strongly typed object to work with the underlying data and return it to the big honking collection.

Sound like a bad thing?

JoeFallon1 replied on Wednesday, January 21, 2009

I actually have something like this in my app.

A single table holds "messages" of various types. I have a Base Msg class that has the common elements in it. Then I derive each of the various kinds of messages from that. The collection can fetch any one of the types of messages using a filter and stores it as the Base type in the collection. When using it I can cast each object to the correct msg type.

So I am saying this can and does work.

Joe

esteban404 replied on Wednesday, January 21, 2009

I hoped it would work. I was having a devil of a time rebinding data to grids when switching "perspectives". I'm going to just load the data as needed when the technicians load up an order rather than all possible records. The viewed data is a read only list, so I hope it'll be manageable.

I was toying with the idea of an uberclass class as you mention. I determined I could show/hide columns in the grid based on the field names in the object. It uses reflection, so I may manually place the visible column names into a list in each object to reduce processing overhead. I doubt it'll be much.

Thanks for your input, Joe,

_E

Copyright (c) Marimer LLC