Reputation: 552
I am working on a web platform that uses MySQL as DB. I am also making a mobile app for the platform and using APIs to fetch data from DB. What is the mechanism to keep a single SQL queries set that can cater to web and Mobile App APIs without compromising their distinct requirements. If there is a fix to sql queries I have to do it twice and I want to avoid that as its error prone.
Upvotes: 1
Views: 109
Reputation: 9456
Create the Data Access Layer as a library. Adhere to the open-closed principal to allow your objects to be extended as needed to handle the peculiarities of your requirements.
Upvotes: 1