1

We're currently upgrading some components of our application to new technologies such as C# using WPF and MVVM. Since we try to avoid past mistakes that have been made in our now legacy applications, a question came up in our team how we should ship external resources that are likely to change, such as icons or images. In our legacy applications they were basically embedded in each applications, which required a full recompile of the applications just to change some icon. We don't want to just dump the raw files into a folder either, since some of them might be licensed and shouldn't be directly accessible to the customer.

We thought that we split all our resources into an external file (such as a DLL), which all our applications can access. So every time some resource is changed, we just have to ship a new version of our resource library. However there are some cases, where a general storage is not desirable, for example if just one specific icon in a single application should change. If we'd just replace that resource, it would likely change in all applications using that resource.

How do "big" applications handle this or is there a best practice in how to do this?

  • I think the DDL (or package) option is the best approach for desktop applications. May be just one icon for now, but you will be prepared for more if you change your needs. Another option is to cript the images and decript when the application need it. Your customer will not be able to access it. – Magno C May 22 '14 at 11:27
  • how often do those things really change? In my experience very rarely, unless maybe you're doing customer branding in which case it makes perfect sense to have all stuff specific to each customer in a library for that customer that's shipped only to that customer. – jwenting May 22 '14 at 12:58
  • Our boss/president likes to change small stuff like that often. Don't ask why. We definitely can't change him. – Lennart May 22 '14 at 13:00
1

You can consider putting these resources up on a website (or network location), and have your application download and cache on the local device. Every time a connection is available, the application would check if the resource has been updated, and if so, download it again. This will allow single resource to be changed without affecting others.

This even allows some advanced cases. For example, if you have two places in code that reference the same resource (such as an image), this allows you to embed two different URLs in those two places. However, on the web server, you could still have the same image served without even duplicating it (e.g. links, redirects, etc.). If at a later stage, the image needed to be changed in one place in the app, you only need to update the server without redeploying the client.

Some caveats include ensuring that you have SSL/TLS connection so it's not easy for some rogue site to act as your server and throw in malicious code/content on the device.

As you add more apps, you can reuse the same, and if you were eventually writing a Web Application, then this is how you would be serving resources anyway.

  • My only complaint about this answer is that it seems a bit of an overkill, but it would allow the most flexibility for sure. – Neil Jun 17 '14 at 7:56
  • Indeed, but the questioner's boss is also asking for an overkill. If it were a web site, then using such resources would be the right way to go, although the caching would be handled by the browser. So it's a pros/cons discussion for the questioner. Personally, given the scenario, I would still go with this because I can sense endless deployments, which is a bigger productivity loss at times, so I'd rather pay the cost upfront. – Omer Iqbal Jun 17 '14 at 8:16
  • It's hard justifying the construction and maintenance of a server for icons, however again, that may be what the OP is looking for, so I can't really penalize this answer. Though I tend to agree with you about paying the cost upfront for such issues. If a programmer always starts with the most flexible option, he or she will never have to restructure the program later. – Neil Jun 17 '14 at 8:48
0

On Apple's OS X, applications are shipped in a special directory where a Resources subdirectory stores all app resources, such as icons, graphic art, localization data, custom libraries, scripts...

Nothing is crypted, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.