I’ve got some criticism from Alex Golesh in a comment on one of my latest Posts (Managing Silverlight resources contained in external assemblies), First I would like to thank him for taking his time and writing this comment, I would like to reply him with this post. First let’s see Alex’s Comment:I have to comment it, because the code lead to bad practice...First, it heavily assumes you have all you assemblies in single XAP package - which is a bad practice for "heavy" Silverlight applications and especially real MVVM based applications. Second, XamlReader will throw an exception if you resource (XAML) have a refernces to external resource dictionaries.Last, but not least, this code will not work in SL3 and Silverlight for Windows Phone 7. Regards,AlexAlex’s first point is what really made me write this following post, but I will get to it later. His second point is just plain wrong, I’ve created a small sample proving it, it is not very interesting sample as it self in my opinion but I just don’t want you, dear reader, to refrain from this solution on basis of Alex’s false assumption. You can download it here. About Alex’s last point, It might be that it will not work in SL3, I’ve not tried to test it on that SL version, Even how I wouldn’t recommend you developing RIA in SL3. About Windows Phone, I reckon that on the Phone platform a different approach is needed to be used, the code to manage resources is used when writing decoupled modules should be tuned to the platform specific needs. Anyway it is out of scope from this post, I will leave it for future post. Now, let’s talk about Alex’s first point, it really boiled my blood , an assumption so wrong, I’ve not heard for a long time, the whole purpose of that post was to allow you writing separate modules (which every module comes as his own XAP package) by keeping resources separate as well in order to refrain from tight coupling it in the first place. Now what really made me laugh is that each resource dictionary usually contains DataTemplates which pair a view and its ViewModel, an essential phase for maintaining MVVM . Read more: Ariel's Remote Data Center
0 comments:
Post a Comment