How to take the next step on the software development path?

We’ve probably been on this path for five years or more. How do we get further away from the masses and get better at our work? Architectural design should be one of the directions, from the design of the entire APP to the design of every page and function. This article will talk about the architecture design of App based on my research and development experience.

First, the code needs readability

Readability is very important, you can even do all the functions of an APP in one UIViewController, and it might have tens of thousands of lines of code, hundreds of thousands of lines of code, and how to maintain it, how to read it, and when you write it, only you and god know what’s going on, and after a few days only god knows why the code is written that way. Because the code is so complicated, hundreds of thousands of lines of logic in your head, I think your head will explode, now in the MVC framework Controller has a thousand lines of code, even feel painful, let alone hundreds of thousands.

So there’s a principle of readability. Code can be ugly.

We, the older generation, made a lot of attempts at readability, and some of them turned out to be appropriate and comfortable to use, and those attempts were summarized into principles that we all followed and agreed on. For example: Six design principles.

Thanks to them, we stand on their shoulders.

Second, the code needs to be extensible

Extensibility, different people have different opinions, this is a very test of internal merit, some people can build a good architecture from the beginning, and some people who have been working for a few years still can’t make forward-looking technical thinking. According to my understanding, the extensibility of the code needs to pay attention to the following aspects:

  • Product thinking
  • The design specification
  • Technology selection

Code requires product thinking

The extensibility of the code is inseparable from the product thinking. You need to know what the product does now and what it might do in the future, and you need to chat with the product manager until they have a rough plan. Some products may change slowly in the process of practice, and engineers also need to make changes together, and once the reverse change, must be decisive in the code to make changes, otherwise, the subsequent problems will become more and more serious.

For example, if the product is targeted at live streaming, then the corresponding technology stack comes out: FFmpeg, GPUImage, AVFoundation, OpenGL ES, Metal, instant messaging. There may be live delivery, web page, payment, etc.

When the product manager’s operation is too complex, remember to battle, or the resulting code will be a mess and users will probably not like it.

Checking competing software is more intuitive and effective. We obtain useful information by:

  • Existing features of competing products
  • Technical selection of competitive products (simple reverse, analysis out of useSwiftorOC, FFmpeg orGPUImage, and what third-party frameworks are used)
  • Planning direction of competing products

Design specification driver code

Why design for extensibility?

In the process of redevelopment, we deal with design a lot of time. It can be said that a good designer can improve the quality of our code and reduce our research and development time. Then what is a good designer for engineers?

  • Planning (knowing what kind of design I will make now and in the future, being able to find commonalities and abstraction)
  • Logic (good design drawing management, interactive logic, consideration of various extreme cases: such as no network, no data, large screen, small screen, full screen, error prompt, completion prompt)

If the design is not mature enough, let him see the big factory software, learn to go. At the same time we also want to help design children’s shoes abstract.

Technical selection is skeleton

According to the direction of the product type, technical selection, including the following aspects:

  • Languages: OC, Swift, RN
  • Programming: object – oriented, functional, protocol – oriented
  • Third party library: It’s a matter of building your own wheel or using someone else’s wheel
  • Layout: Autolayout, Frame, Xib, Storyboard

Do technology selection, to investigate the community, whether active, whether to continue to maintain, support the iOS system. For example, SwiftUI is not suitable for the selection of a commercial project at present, and Flutter is also not suitable for the present. We need to consider the difficulty of taking over and the recruitment situation of new people in the project later. Although major factories constantly advocate Flutter, there are very few real uses. But it’s not used itself. There is still a trial period for SwiftUI and Flutter to be used. Small factories should not worry about it. Big factories can do whatever they want.

In 2016, I used Swift2.0 to write a project in a startup company. Now I think it was a wrong decision. The immature Swift was not friendly, especially the incompatibility of each version.

The technical selection of competitive products is an important reference direction.

Iii. App needs acceleration framework (Knowledge base)

The company needs to accumulate its own knowledge base and become an acceleration framework, such as the network. It must package another layer by itself, so that the network library of each project can be unified and used in the same way, which saves the time of developers. Usually these acceleration frameworks have little coupling to the App and can be packaged independently. Common acceleration modules:

  • Network modules (upload, download, encrypt, retry, cache, request, and task management)
  • Audio and video module (filter, play, cropping, combination, AV data acquisition)
  • Basic framework (String, Array, Dictionary, TableView, Date and other native frameworks supplement)
  • Data (synchronization, read/write, upgrade, clear cache)
  • Popovers (toast, Hint, Alert)

Audio and video frames can be subdivided: image processing, video processing, rendering processing.

These are the precious wealth of the company, which needs to be accumulated bit by bit. Fortunately, we are also standing on the shoulders of giants. Github has many examples for reference. After perfecting the company’s knowledge base, it will be like adding wings to a tiger and accelerating the development rhythm.

How can I improve my architectural design feel?

  • Code readability, extensibility, improve their own acceleration framework (knowledge base).
  • Be thoughtful and do structure and chart analysis before writing.
  • Communicate more, no matter it is my team members or my boss, or design or product, inspiration is always ready to come.
  • Read the source code of a third party and think about why the author designed it the way he did and what the pros and cons are.
  • Do vertical field, improve their own technical barriers
  • Do the width field, see more Python, Go, Swift, Java, JS, PHP and other languages, see more can be more comprehensive analysis.

A third party library of my collection

Hue Color extension related 2.Snapkit Autolayout layout 3.Realm database 4.RxSwift responsive 5.Hero Transition Animation 6.Lottie Designer Animation 7.Alamofire Network 8 ImageScout minimum network cost to get image size and type class 12.Gifu high performance GIF load 13.Proposer requests local device permissions 14.MonkeyKing SdK-free shared payment (text, image, audio and Video, URL) 15. Sharing between Wormhole devices iPhone Watch 16.Promisekit Asynchronous programming 17.Chamele color frame LSAnimator chain animation is based on CoreAnimation.Blueprints have multiple waterfall streams. SwiftyStoreKit is available for in-app purchase ActiveLabel replaces UILabel 25, Nuke replaces Kingfisher 26, NotificationBanner app notification bar 27, XLPagerTabStrip top Tap switch MonkeyKing Debug: FLEX, VZInspector, MT, GT, MatrixCopy the code

Design principles

  • 🐻 Vernacular understanding of the six principles of design patterns

Add V note: nuggets; Get into groups and learn together 🐻