Parsing JSON in Objective-C - Part 2

Note: This previously was on Pivotal Labs blog. In the previous article, we used TDD to parse JSON into our Person model and refactored the code under test. In part 2, we’re going to refactor the code further to be more reusable and extendable. All the code in this article will also be in the same repository. Redesign The refactorings in the previous article were fairly straightforward and mechanical. Ultimately, we’ll need to break apart different concerns of this code. One approach would be to start with some questions: ...

November 8, 2014 · 9 min

Parsing JSON in Objective-C - Part 1

This post was original written on the Pivotal Labs Blog. JSON parsing is a frequent task for clients interfacing with any recent web API. Those web services frequently vary in quality: Is the API following a RESTful design pattern? Is it providing an object graph or just a single/collection of objects in the JSON response? What are the data types of the fields being returned? Can they be relied upon? How much work are clients duplicating to work around the server (e.g. - Performance, Business Logic, etc.)? If you have full control of the resulting API endpoints, then it is easy to build or fix the API to your client’s specific needs. Controlling the incidental complexity can be challenging for APIs you do not control, or which have to support a variety of clients. ...

October 24, 2014 · 9 min