What is the best way to share resources(images...) between modules. Is it better to keep it in a seperate common project(Infrastructre?) and refer it in all modules and application?
-
1Better than other options like keeping the resources in respective module projects(duplication of the same resource can happen across different modules-the advantage being the modules can be completely self contained). The tradeoffs are there-but which option is recommended? – Jimmy Oct 04 '11 at 13:26
-
possible duplicate of [Best Practice WPF Prism Resources](http://stackoverflow.com/questions/3860949/best-practice-wpf-prism-resources) – Magnus Johansson Nov 22 '11 at 07:55
2 Answers
My advice would be that if a resource is shared, then yes, put that resource in the infrastructure project.
I always have a Resources folder in the infrastructure project, followed by
Resources/Constants.xaml (Brushes, etc.)
Resources/Images/
Resources/Templates/
Resources/Converters/
Resources/Behaviours

- 13,492
- 11
- 76
- 118
I believe that in any project, you should try to organize your resources to minimize duplication. Not only does duplication consume system resources during runtime, but it also makes the application harder to maintain. For instance, if you change an icon in your program, you have to hunt them all down and change them. The larger your program becomes, the more this type of refactoring work will begin to eat away your day.
Now that I've laid down the line, you can possibly imagine instances where you need a certain amount of duplication. The primary reason is localization, where application strings might be in one language or another, or a US English phrase might be different than a UK English phrase. Certain icons in one culture, also, could mean something different in another, but this is all dependent on your applicaton.
I suggest staying as minimalist and organized as you can, and expand when your application demands it.

- 2,289
- 15
- 16