mercredi 29 juillet 2015

RESTkit and Objects Pool pattern

Introduction

I develop iOS application. This is enterprise application. One of the key features of the app is that it must let the user to access their data while offline (bad or no network coverage). Also user should be able to create content being off-line. Eventually, when the user finds network coverage, the app syncs with the server - i.e. pulls changes from the server and then pushes local changes (and data that was merged during pull conflict resolution) back.

Server is RESTful, so I have chosen RESTkit to work with the API on the client. During the bespoken sync I have to handle myriads of objects of the same type coming from the server. As I understand RESTkit creates new object each time it maps each object from the response (i.e. JSON coming to the app on GET). I think that there could be noticeable optimization if instead of creating the new objects each time RESTkit maps I could feed RESTkit with the objects from the same pre-allocated objects pool.

The Problem

What are the ways combining RESTkit and Object Pool pattern? Would be wonderful to hear good recommendations on valid implementation.

Thank you.

Aucun commentaire:

Enregistrer un commentaire