Best Practices for extensible online Database abstraction layer for Android/iOS application?
For Android (or iOS) application development, when you need to access information from a database that is hosted somewhere, like on a website, the common method is to create a page (a PHP page in my case) that connec开发者_JS百科ts to a database and outputs JSON, or a PLIST or whatever. The application accesses that page URL, then retrieves the data and does something with it.
This method allows you to access a remote database without revealing database security details in the code of your application. It's kind of a rudementary abstraction layer.
I'm trying to design this abstraction layer to be as flexible as possible. If I create some page that retrieves some data and it works for my current version of my application, great. But if I change something in a future version and the retrieved data needs to be slightly different, then I have to create an alternate page. I would have to leave the old page untouched, for fear of breaking any older versions of my application that are floating around out there.
Is there a good approach to designing an abstraction layer like this that is flexible and future-proof (as much as possible)?
精彩评论