0

We make iOS apps where we often get data in a list from an API, then we select the data and go to the next ViewController.

Often it happens that the server is down or some API is not ready.

What is a good development practice where we can continue our regular work flow without depending on the webservice and then when its ready without making much changes continue using the web-service and till then use some fixed data.

  • Do you know name of methods, and input/return parameters in the API? – razethestray Jul 7 '13 at 12:15
  • yes. we know it. – Amogh Talpallikar Jul 7 '13 at 12:17
  • Do consider the utility of having a mocked out webservice for development and testing. It is not an uncommon problem for split development - and if the other team takes down their webservice for a hardware upgrade, why is your development stopped? – user40980 Jul 7 '13 at 21:34
  • What we generally use to do was consider the API working in dev stage. used to working in small teams making small apps. but now that we have started working in larger teams where backend devs are somewhere far away, we realize the importance of such things. – Amogh Talpallikar Jul 8 '13 at 5:07
  • "why is your development stopped?" for UI elements that used to be displayed based on data coming on server. like in one screen, how many fields a form will have and hat type also comes from server. and the JSON is quite complex to be able to simply reconstruct a valid one to continue dev and try various scenarios. But I got Brian's point in razethestray's answer. – Amogh Talpallikar Jul 8 '13 at 5:10
3

Since you know how the API will be accessed, and what types of values will be returned, you could create your own basic version of the API that just does something basic with your input and returns something like what would be expected. Then when the API is ready you can just swap it in.

Afraid I can't provide any detailed instructions for how this would be achieved for iOS, as I am not familiar with iOS development. However, I have worked on a project where one set of developers was working on the front end in one country and a separate company in a different country was working on the web service. The UI developers were accessing a basic javascript library that just returned test data, and the back end developers were passing in values to the service with a very basic test harness. There were a small number of issues to be ironed out when the two were put together but altogether it worked quite well.

  • It will take some additional development time to create the temporary service. Is it worth it, if the time taken to make it will be the same time for which if we wait,we will get the service up and running, ie.next day. – Amogh Talpallikar Jul 7 '13 at 12:33
  • If you are getting the service the next day, probably not. If there might be times in the future where the service is unavailable again, then maybe. – razethestray Jul 7 '13 at 12:37
  • 1
    In a pinch, you can, instead of creating the api, create an interface wrapper around the api. Then, implement that interface as both a hard-coded test interface and as calls to the API. This is similar to raze's approach, but here you are creating a mock interface to an api, rather than a mock api. – Brian Jul 7 '13 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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