The principle to be adhered to for the extensibility of the code when designing Iosapp

Source: Internet
Author: User

As a iosapp of software engineering, in order to maintain the maintainability and extensibility of the code, it is necessary to abide by the basic features of the softwares, which are known to have such characteristics as high-cohesion low-coupling programs.

First, it can not depend on storyboard and xib, the original is obvious. 1th, in the source control aspect, in the team project, once someone changed a little content storyboard will show modify appearance, so people look very uneasy, in fact, with M the reason is probably the other team members mouse hand Click just a bit, The integration of the latest source control tools in Xcode basically solves this problem, but it still generates serious code conflicts, which is not what the team wants to see, so few user experiences and powerful apps are in the form of storyboard.

Let's talk about how you can make your code easier to maintain and easy to scale.

What is the most important thing in our work? Of course it is progress. We have a natural inability to keep up with the progress of the function extraction and module reconfiguration of the code, so we need a leader who understands the software life cycle and sees the future of the software to lead the team. At the beginning of the product can be used for the molding speed and give up the extraction of code and even for the product can be early on the line and write the controller very heavy code, in fact, in many companies are such thousands of rows of controllers everywhere, a map application products in the domestic controller has 2+w line, The code for repeating code and layers is naturally very much. Later maintenance is really hard to go on. And this time as the head of the team, it is necessary for the team in order to make sacrifices for the company, as far as possible to urge the team members to standardize the code to write, product Manager is always in Cui, the eldest of what you need to do is to mediate between the program ape and the product, that can not ignore the product can not completely sacrifice apes. Good offices are all naturally understood, and what is discussed here is what the apes need to observe:

1. The code must be hierarchically divided, in order to catch the duration can produce duplicate code, or do not extract many of the parent class, but the code must be let version control tightly controlled.

2. Just get the task of the person, unless it is a long time to work Daniel, otherwise, is basically in the test water, it is impossible to directly complete a module of the top class and method of extraction, of course, except the model, because the product design phase has completed the task. You can try to complete the function first, then the top-level parent class of the code or the extraction of the repeating function.

3. Be sure to abide by the MVC design idea, do not appear in the Controller for attribute assignment operation, but through the object to carry out data transfer, as a bridge controller, if the burden of overloading will inevitably produce program instability.

4. This article is only the author's own experience, just want to record and share with you.

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.