Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about an Object!

Status
Not open for further replies.

cyberwin

Programmer
Jan 31, 2008
1
0
0
US
I am developing a web application that is really nothing more than a catalog for my company. (The company distributes medical clothing)...

I have a class PStyles
and a class PStyleCollection (which is exactly what it sounds like)... Then in the datalayer, there is a function that returns PStyleCollection to be used as a repeater datasource on the front end...

Here is my question. And, I don't expect there is a real answer, I just want some opinions.

At the moment, when each PStyle is displayed, I link to an image on the server... So, what I am considering is actually including an image as part of the object...

Private _styleImage As Image
...
Public ReadOnlyProperty StyleImage As Image
Get
Return _styleImage
End Get
End Property

One issue I can think of is that at any given time, there are about 100 or so styles in the collection. And, unless the user is using filter, the entire collection gets returned. That is a lot of images in memory...

Thoughts?
 
If memory usage is shown to be a problem, you can lazy-load these images.

Use a property, and in the getter, if the member variable for the image is null (empty, etc) then call the code to fetch it at that time.

This delays the memory hit, but at the cost of slower performance when you go to actually show the image.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top