What is the MVVM?


1. MVVM is a variant of Martin Fowler's PM design pattern 2. Both MVVM and PM come from the MVC pattern 3Copy the code

Make a long story short and get to the point


The following requirements are now common in iOS development recruitment:

X. Able to independently develop high-performance App X. Familiar with MVVM and other design modesCopy the code

Interviewers also like to ask, do you know anything about MVVM?

This would not be the case if they really knew MVVM, or if the interviewer who asked you about MVVM had only half a clue that something novel was good and appropriate, which is a misconception

First,MVVM is not new. John Gossman, one of Microsoft’s WPF and Silverlight architects, published MVVM on his blog in 2005

Second, as part of the MVVM component, there is a binder. IOS development requires the addition of a responsive framework such as RxSwift to play the role of responder, which is an additional burden

Third,MVVM creator John Gossman himself believes that the overhead of implementing MVVM is excessive for simple UI operations and can result in considerable memory consumption when larger applications are applied

Fourth, MVVM appeared in 2005, the first generation of iPhone appeared on January 9, 2007, Apple official and Stanford iOS development video are mainly promoting MVC architecture, if MVVM is really a better architecture, it must have been widely promoted

In conclusion,MVVM architecture is not new, will bring unnecessary overhead, not suitable for iOS platform development, high performance App and application MVVM is contrary, all requirements of MVVM and interview questions MVVM are nonsense

There are many ways to optimize code, so why choose a niche framework that will increase memory consumption and make debugging more difficult? In other words, what does code optimization have to do with architecture? Does the same person writing code in different architectures perform better in one?

So, who knows where the confidence comes from to convince these interviewers and recruiters that MVVM is a more advanced architecture for iOS development

Conclusion, do not believe the so-called great god in China, there is no god in China, there is no god abroad, the pioneers described their own experience, does not mean they are right, just like Pluto is no longer a planet

One caveat: Don’t tell your interviewer this, because there’s a good chance you’ll be branded as inferior

You might think I was nonsense, no basis, I can only tell you that I am not the so-called great god, also does not have the advanced technology, but it all, baidu encyclopedia all didn’t tell you, zhihu, Jane books and the Denver nuggets, and so on a series of MVVM related articles and didn’t tell you, only I, consumedly square square to tell you

I, on the other hand, am just a Wikipedia blender, an outspoken blender, a well-rounded moral, intellectual and physical coder

Reference data: zh.wikipedia.org/wiki/MVVM