Streamlyne / Cocoa-SDK

Streamlyne API for Cocoa Developers
https://github.com/Streamlyne/Cocoa-SDK
2 stars 1 forks source link

Improved Store #10

Open Glavin001 opened 10 years ago

Glavin001 commented 10 years ago

Base off of http://emberjs.com/api/data/classes/DS.Store.html

Currently MagicalRecord's [NSManagedObjectContext MR_defaultContext] is the effective store, backed by CoreData.

Glavin001 commented 10 years ago
Glavin001 commented 10 years ago

The more I think about it the more I believe that SLAPIManager should really act as the Store and the Adapter, since the Store is really CoreData but that layer is already implemented and it would be redundant to add something to the CoreData NSManagedObjectContext since MagicalRecord makes it pretty easy to use already.

Continue on with #7

Glavin001 commented 10 years ago

Okay, so I created a SLStore class..

It should create it's own NSManagedObjectContext and use it internally.

The SLStore (Store) should be associated to a single SLAPIManager (Adapter) which has a default and generalized Serializer that has registered all of the Transforms.

Yes, this will be HEAVILY inspired by Ember. And I like it!

Glavin001 commented 10 years ago

Similar to Ember, the Store could be what is created (instead of SLAPIManager) and then it would automatically create it's own API Manager (which could be overridden).

Glavin001 commented 10 years ago

Instead of using Strings like Ember it would be great to be able to pass Classes and therefore verify that the model class exists and can be instantiated right on that class argument.

Glavin001 commented 10 years ago

Only allow SLModel classes as modelClassarguments. Seehttp://stackoverflow.com/a/5874006/2578205

Glavin001 commented 10 years ago