jeudi 10 décembre 2015

Design Patterns - Database Columns Dependent on API Keys

I'm working on an iPhone app and am currently building out the Web API in PHP. For this application, I'll be importing data from a 3rd party API to store in my server-side database periodically.

My Question: It would be easiest if each of my Database columns were named the same as the corresponding API key from which I'm pulling. This way, imports are very easy. However, my database will then be highly coupled to this 3rd party API, and if they decide to change their API keys one day, I'll have to change my database columns.

Whats the best way to handle this sort of situation? Do I make some sort of key mapper? Also, as I'm solving this issue, does this fall under a certain Design Pattern? If so, I'd love to do more research into that.

Aucun commentaire:

Enregistrer un commentaire