Udi on strongly typed collections
Udi Dahan – The Software Simplist: Code breaks, automated code breaks automatically
Good point Udi,
My concern about the memory usage was not only the memory used by the static collection itself but also the fact that you end up creating the same collection in memory twice. Once when you create the DataSet/DataReader and then again when you create the strongly typed object for each row in your dataset. Since I’m working in a web based environment I end up creating everything on each page load unless I cache the collection. This works when the contents of the collection are shared by every user of my system, say if I cache the strongly-typed collection that is the data source for a drop-down control. If the contents of the collection are specific to a user, in my example a collection of patients that the user is allowed to see, then I have to cache each collection seperately.
I explain myself a little better in this comment.
-
http://TheSoftwareSimplist.com Udi Dahan – The Software Simplist


