Domanda

Our current scenario seems to be tailor made for .resx files, but my understanding is a bit murky, and I am looking for some calcification.

Our webApp is skinned differently for our different clients, but the difference is not the same for all clients. By that I mean one client may only want to change the logo, while another client may want to change the logo, some buttons and maybe the background color.

To address this requirement I have created a default.resx which houses our default skin, all the element images, strings, and color codes. As well as a client.resx which houses only those elements that are unique to the client (the different logo, and buttons) or what ever.

I then made a resource manager that will check the client.resx for a resource, and return it to the page, if the resource is not present then it will retrieve the image from the default.resx.

One of the other developers says that this is inefficient and rather then use the .resx file we should have an image folder tree and re-tool the resource manager to use image path locations instead .resx resources.

I do not know enough about how the images are served up through the .resx file vs how they are served up through the folder tree and can not rebuke his claim. I think that the time needed to server up the image trough the .resx vs the images in the folder is negligible at best but I am having trouble locating any specific information regarding this. It would not take much time to redesign the resource manager to do it the way he would prefer, but I want to make sure his claim is legitimate before I invest the time in this process.

As a side note we are talking about 100+ images that can very.

È stato utile?

Soluzione

I'd like to recommend you to give opportunity for your customers to change the CSS file, not a resx file to change the background / colors / images, etc. So you will have some default CSS file which customers can override (they will have chance to upload their css files or just replace it on server). In your default CSS you should have CSS classes with links to your images as backgrounds (logo, etc). So if customers want to change logos / images / colors - they can just put some images on server - replace CSS file and check that everything will look fine. And for strings just keep using the resx files.

And answer on your questions: if you will have 100+ images - I think will be better to have files in some folder instead of resx file (you want to put in resx file all images as a raw data, right? or you will have just links to right images). File can be huge if it will contain all images as a raw data, so to parse it you will need a lot of RAM. And also I don't think that you will need them all in one place, maybe some of images you will show just couple time in day, right, so will be better to not load it. But if all of your images you will show on the main page (or master page, whatever) - if you will use caching you will not see a big difference in performance.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top