IOS Architecture: From the Shallower to the Deeper
This post talks about ios architecture method from traditional MVC pattern to more comprehensive organized ios architecture.
It has been 10 years since iOS was born in 2007. The sedimentary accretion of technology over last 10 years has ensured an active sharing environment but at the same time also has created a barrier for screening out the valuable knowledge. Taking iOS architecture as an example, I will comb through four most frequently applied architectures and analyze the current situation of ios App ui design on a larger scale. To some extent, I believe that techniques should be ahead of business. In other words, developers should be prepared for that change in advance. How the business direction will change? Is the current architecture flexible enough to make that change at the lowest cost?
1.the model-view-controller pattern(MVC)
If this sounds familiar to you, you may have already known the advantages and disadvantages of the UIViewController. You might also have read a lot about MVP, MVVM, MVCS, etc. However, in the traditional MVC model, it does not convince me that it reaches the usability design requirement in iOS application because model, view, controller are highly coupled. Although it is possible to implement the traditional MVC in iOS application.
While in Apple’s MVC, the controller plays the role of a mediator and what you have to do is to fully grasp the definition of the model, view, controller and the standard of the data flow. Many problems and solutions of the small apps are hidden in this.
2. Synthesized iOS architecture
For mobile app screen design that have tens of millions of users, thinking only on the level of MVC can hardly bear the rapid growth of the business. Apps at this level usually need much deeper design thinking by professional architects. This level is not only testing the technique accumulation of the architects, but also the comprehensive understanding of the business. In Synthesized app architecture, MVC will not be often put forward to be discussed, the differentiation and coupling of “layers” and “modules” are more often the topic.
3.In-depth-optimized iOS architecture
Synthesized iOS architecture is the only way of business booming. Once it’s formed, business surging in the later stage will continually in turn polish the architecture itself. The product’s pursuit of user experience and quality will force architects and technical team keep on optimizing the details of the architecture. This optimization can be divided into two parts. One is that the module will be refined deeper and deeper. Another is the in-depth optimization of the module, for example, the in-depth optimization of the web layer, like sqlite optimization( multi-thread, FTS, security ), data encryption, Hotfix, Hybrid, etc. Some open source third party libraries can no longer fulfill their needs, so the team need to build the wheels on their own.
4. Organized iOS architecture
Organized iOS architecture steps further than the in-depth-optimized architecture. Besides focusing on the architecture design in the system layer, organized architecture also cares about principles of the cooperation method in the team, the iteration method of system modules, the product publishing process. Except for the pressure brought by business growth, personnel and teamwork problems as well influence the quality and iteration speed. All of this can and should be solved from the architecture layer.
These four iOS architectures discussed above also can be viewed as the growing process of an App or a company from simple to more advanced.It is worth mentioning that the architect's vision and accumulation areusually limited by their own experience of the size of the project and business. Developers and architects better seize the opportunity of working in giants like Google or Facebook to gain the depth and breadth of knowledge.