0

I would like to ask an architect based question

What is more secure and most standard way to follow.For let's say a mobile application,

Should the Api for mobile interaction with server be different than CMS (cms to use its own database queries AND functions) or should cms and app use same api integrated inside CMS.

1 Answer 1

1

I'm going to assume some things about this question.

  • When you say API, you mean an API based on a Web Service (HTTP/SOAP/Etc).
  • When you say CMS, you are referring to a CMS for a website, and that it has it's own API.

The nice thing about having an API, is that it can give you can get and send data (JSON/XML/Etc) from the service in a language agnostic way. Any system in which you can view webpages, means that it has the capability of consuming an HTTP API, which is nearly any language or framework.

This means that your android/ios/web app basically only have two concerns, UX and communication with your web service. Making sure that your service is doing the heavy lifting means that your interface projects can be generally "dumb". This way helps prevent duplicated code between all projects (DRY).

I'm willing to doubt that the API included in the CMS is going to cover all of your needs, so I would recommend implementing your own as well for logic specific to your business logic.

This is only highlighting the benefit of why you may want to do this approach. Weather or not these techniques seem useful for your specific project is up to you.

5
  • So the problem is my web guy is mingling my WebService with CMS API. That's the question i want to ask, is it advisable or not? Jun 18, 2015 at 23:09
  • What is CMS Api? Jun 18, 2015 at 23:11
  • simple CMS Coding i mean.... Jun 19, 2015 at 4:10
  • There isn't one CMS code or framework. A 'Content Management System' can be built in anything. You aren't telling me what CMS you are even talking about. Jun 19, 2015 at 4:15
  • 1
    I think you answered the question well enough. I would add that, while it is often nice to think of everyone sharing the same api, in real life, my mobile api's have sometimes been slightly different, so I've had to refactor code at a slightly lower level in order to not repeat code. For example, my mobile getPerson() function would return something different than my WebSite getPerson(), so I had to create a getCombinedPerson() function that both getPerson() functions called that did the real work, with the getPerson() functions just translating the results into the right response. Jun 23, 2015 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.