CodeIgniter Forums
Web Services Pattern? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Web Services Pattern? (/thread-43317.html)



Web Services Pattern? - El Forum - 07-07-2011

[eluser]jtmgdevelopment[/eluser]
All,

I am creating an app that will use a 3rd party web service for 95% of all data exchange from the end user. I am using Spark Rest/Curl libraries for the api calls.

My question is where should I place these calls to the webservices? Should I place them in the controllers or should I created models that will represent the api calls?

Thanks for any help.


Web Services Pattern? - El Forum - 07-07-2011

[eluser]jmadsen[/eluser]
When I've worked on similar things, we have used a library for the actual api calling code, and done the rest of the work from a controller. If this data needs to be passed to your db, then add a model for it


Web Services Pattern? - El Forum - 07-07-2011

[eluser]jtmgdevelopment[/eluser]
Can you explain the "using a library for the actual api calling code" in more detail. I appreciate it.