PHP as a service-side Android, Apple as a client, PHP API interface should be designed to solve the new and old version and Android and Apple version inconsistency, 2. How to design the interface to ensure the scalability and flexibility of the function
Can you give us a complete example or a way of thinking about it?
Reply to discussion (solution)
It's too much, but the core is a little bit, the calling interface backwards compatible, back data backwards compatible
It's too much, but the core is a little bit, the calling interface backwards compatible, back data backwards compatible
I'm not sure I can tell you more.
The request interface will pass the version number and source (iOS or Android), you can return different data according to these two parameters
1, design a version of the table, there are cell phone Type field, version number and other fields, check the time, according to the two fields to find the ID, and then check the cell phone Type field the highest ID, compare, big on the prompt to have version update
2, do not know
The request interface will pass the version number and source (iOS or Android), you can return different data according to these two parameters
Can understand the Andro and Apple interface to separate the same thing the service side to divide two, increase the maintenance amount
The service side is a sub-component.
The request interface will pass the version number and source (iOS or Android), you can return different data according to these two parameters
Can understand the Andro and Apple interface to separate the same thing the service side to divide two, increase the maintenance amount
I am a copy of the processing logic for iOS and Android most of them are the same, and different places are written separately
The inconsistency of the place is written separately, is not the if else. As for extensibility and flexibility, this does not know where to start, a few more changes.
PHP (underlying) <--> Java (middle tier) <---> Client (ios/android)
The PHP side only to do logic processing, including updating the database and so on;
Java side to do data format conversion and processing (LZ questions can be placed in the middle layer)
The client will be able to display the data directly from Java.
Thank you for your enthusiastic reply.