Friday, May 29, 2015 [Tweets] [Favorites]

Network Request Templating

Soroush Khanlou:

This way, all the logic tied to a particular endpoint is located in one class, and any class using it gets fully baked objects in their completion block.

[…]

One of the big benefits to separating request building and response handling into their own objects is that users can inject whatever request builder they want. If their data comes back in MessagePack format, you can bring your own response handler when needed. The NSURLSession could also easily be injected.

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment