官术网_书友最值得收藏!

Is there a downside?

There are, however, a few drawbacks to using MVVM, and it will not help us in every situation. The main downside to implementing MVVM is that it adds a certain level of complexity to our applications. First, there's the data binding, which can take some time to master. Also, depending on your version of Visual Studio, data binding errors may only appear at runtime and can be very tricky to track down. We will however look into solutions for this in the next chapter.

Then, there are different ways to communicate between the Views and View Models that we need to understand. Commanding and handling events in an unusual way takes a while to get used to. Having to discover the optimal arrangement of all the required components in the code base also takes time. So, there is a steep learning curve to climb before we can become competent at implementing MVVM for sure. This book will cover all of these areas in detail and attempt to lessen the gradient of that learning curve.

However, even when we are well practiced at the pattern, there are still occasional situations when it wouldn't make sense to implement MVVM. One example would be if our application was going to be very small, it would be unlikely that we would want to have unit tests for it or swap out any of its components. It would, therefore, be impractical to go through the added complexity of implementing the pattern when the benefits of the Separation of Concerns that it provides, were not required.

主站蜘蛛池模板: 汉阴县| 襄城县| 咸丰县| 房产| 荃湾区| 林芝县| 南岸区| 上犹县| 万荣县| 沅陵县| 青冈县| 防城港市| 巴林右旗| 阿勒泰市| 梁河县| 黄石市| 涿州市| 项城市| 阜康市| 项城市| 五指山市| 澳门| 扎兰屯市| 阿荣旗| 荔浦县| 丹阳市| 定日县| 临安市| 丹江口市| 革吉县| 贺兰县| 阳城县| 庐江县| 彭泽县| 明光市| 阳春市| 仲巴县| 德昌县| 墨竹工卡县| 长宁区| 临沧市|