Many versions (andriod1.2.3.2, iphone1.2.2.3, ipad2.5.3.1.) will be encountered during APP development interface ...) many clients (Android, iphone, and ipad), because the products are iteratively developed, different clients may have different versions of the design logic, resulting in the code... many versions (andriod 1.2.3.2, iphone 1.2.2.3, and ipad 2.5.3.1...) are encountered during APP development interfaces ...) many clients (Android, iphone, and ipad), because the products are iteratively developed, different clients may have different versions of the design logic, as a result, there are a lot of such if judgments in the code, and the maintenance and code readability are very poor. How can this design make the code and logic clearer and easier to maintain?
Or what design patterns should this product meet or meet when writing code?
Reply content:
Many versions (andriod 1.2.3.2, iphone 1.2.2.3, and ipad 2.5.3.1...) are encountered during APP development interfaces ...) many clients (Android, iphone, and ipad), because the products are iteratively developed, different clients may have different versions of the design logic, as a result, there are a lot of such if judgments in the code, and the maintenance and code readability are very poor. How can this design make the code and logic clearer and easier to maintain?
Or what design patterns should this product meet or meet when writing code?
The APIs on the major version can be differentiated by URLs. different versions of the backend are deployed on different addresses, such
Http: // xxx/api/v1/xxxx
Http: // xxx/api/v2/xxxx
Iterative development does not mean that you can modify the interface without complying with any constraints. if there are many items, it means that your interface is not well considered in the design at the beginning. If you release a product that is iterated in this way, do you have to worry about yourself.
I suggest you read a book titled refactoring: improving the design of existing code. There are several different practices for if ..
In addition, do I think these logic or version judgments can be maintained in a static file?