Strongly typed objects and collections vs. performance
Strongly Typed Objects – I’ve lost a battle, but will win the war.
Plip, whom I’ve never met but I’ve heard about (He was “on the runway as we speak” the Saturday afternoon I hung out with Wally McClure and watch the NCAA game) has a series of articles detailing how to create strongly typed objects and collections of those objects. The idea is you use them instead of DataSets or possibly DataReaders. I’ve implemented quite a few strongly typed objects but I’ve never created a collection for them unless I was sure they wouldn’t hold very many. Why? Performance. I’m usually developing web based applications.I avoid creating a large number of objects unless I’m sure I can a) cache them somewhere b) they are really tiny objects.
Right now in the system I’m developing I have a “Patient” object, it makes sense to create a “PatientList” collection and use that for binding to DataGrids, Repeaters, and what not. The problem is we’ve only had the data import running for about 4 months and we have 2700+ patients in it. So a typical patient list collection would have about 900 or so patient objects for a given user. That seems like a awful lot of overhead just to be able to type “lblPatientName = Patient.Name;”.
Has anyone else implemented a strongly type object collection with a large number of elements? Have you seen any performance hits? How does it perform? Is it worth it?
update: I apparently decided to spam Plips comment section for this post. Whoops, sorry about that. 1/2 the .text sites seem to have trackback enabled and 1/2 don’t and you never know which 1/2 your dealing with.



Pingback: Lazycoder weblog » Udi on strongly typed collections
Pingback: strongly - StartTags.com