简体   繁体   中英

Do I need to use a BaseClass for this scenario?

Basically I have a class called Asset which holds all the information for an Asset in my system. This can get quite big (Assets have Thumbnails, Filenames, Metadata, Ratings, Comments, etc).

On my results page, I list all the Assets that match a particular criteria which then can be filtered using jQuery.

I was finding performance issues in IE8 so the first thing I did was look at the Asset class and see what was not needed for displaying an Asset on the page. (Later I visited my jQuery and found that it was what was causing the performance issues).

So, when I stripped my class right down to basics, I made that the BaseAsset and derived Asset from that.

My question is, did I need to do that? was there any need?

I shall provide examples if necessary, but I am refraining at the moment, because the post could become quite big :)

I don't think you need a base class per say, I think what you need is to send what you need. It seems that the problem simply was the fact that you didn't need all of the data all of the time.

I know it's tedious, but only send what you need , when you need it , and you won't have any problems. When you need more data, then either load it asynchronously with an AJAX call, or even make another page that the user navigates to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM