Wednesday, September 5, 2012

Question #1: Where go the events?

I.e. UI events. If MVVM prescribes a no-codebehind vision, where are the UI events (e.g. on-change states of datagrids, etc.) handled? Declarative triggers? MVP appears to make allowance for the events (commands are handled well by MVVM). Can we live without UI events? More specifically, can we do without handling them in the codebehind. The workaround I suppose is to use custom attached behaviors or EventSetters.

Tuesday, September 4, 2012

Tradeoff #1 - DRY vs. SRP

DRY vs. SRP

I think the conflict is clear. A method or class doesn't quite fit a new use case. Rather than extending the class or method a little bit, it might be better to clone it and change it to fit the new circumstance. Sure there's some repeated code between the two methods, the original and the spin-off, but you've stuck to SRP and I believe the result is more maintainable code. And in the future when you have time you can modularize and refactor the shared code.