MVVM standardization

前端 未结 2 725
抹茶落季
抹茶落季 2021-02-02 18:13

Someone in Silverlight posted that MVVM currently lacks standardization so that everyone has own flavor..

That\'s why me and a few guys from WPF Disciples are actively

相关标签:
2条回答
  • 2021-02-02 18:16

    I think the communication between View ViewModel via databinding is what makes MVVM it's own pattern as opposed to other separation of concerns. It isn't so much whether it whether its GOOD or BAD for the vm to know about the view via interface, but in the context of communicating the pattern being used it is not MVVM.

    Some of the difficulty in getting and maintaining standards lies in the shortcomings and complexity of WPF and Silverlight, sadly. When there are multiple valid standards however, I would put on my Martin Fowler hat and add a "when to use it" section.

    Do your standards cover cross-cutting concerns like localization?

    FWIW I like the content of what you wrote and am glad you posted it here...

    Cheers,
    Berryl

    0 讨论(0)
  • 2021-02-02 18:23

    I like what you have written. One of the things that really bugs me is that a lot of people seem to have their VM coupled very tightly to their View - if you are doing this then you might as well just be doing the old XAML + everything whacked into the code behind thing.

    The pattern I use is a slight variant on the MVVM (but it is mostly the same). Personally I like to have my ViewModel given to the View as an interface - it keeps the separation very clean. This has a lot of benefit when doing prototypes, visual elements can be switched in or out of the View with little or no impact on the ViewModel.

    0 讨论(0)
提交回复
热议问题