• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSInMemoryStoreType: Not really "persistent", is it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSInMemoryStoreType: Not really "persistent", is it?


  • Subject: Re: NSInMemoryStoreType: Not really "persistent", is it?
  • From: Bill Bumgarner <email@hidden>
  • Date: Tue, 21 Oct 2008 16:53:18 -0700

On Oct 21, 2008, at 4:43 PM, Jerry Krinock wrote:
An NSPersistentStore created with NSInMemoryStoreType is in volatile RAM or VM, and is therefore not what I would call "persistent". So, why is it an NS^Persistent^Store?

My guess is that NSInMemoryStoreType was added too late in the development of Core Data to change the names of the NS___Store and NS___StoreCoordinator.

Is there a better explanation?

(I'm just trying to understand the terms here.)

Well, it is persistent. Just don't turn off your machine or shut down the app.


In all seriousness, a persistent store the interface between the coordinator and the permanent state of your object graph -- both for reading and writing. When you push a change into a store, that change effectively becomes a permanent part of that objects state. That the actual storage is in memory vs. on disk is irrelevant.

The in memory store is actually extremely useful for caches and as a backing store for applications that read/write to/from some kind of server -- typically an XML RPC of some type -- that wants to take full advantage of CD's object graph management infrastructure. The various change hooks on the MOC and coordinator make it possible to easily mirror the changes out to the wire protocol or update the local cache -- the in memory persistent store -- with changes pulled from the other side.

(I did a little demo app at one point long ago that used an in memory store to cache results from Amazon's web services API. The front end was all pure Cocoa / bindings / CD with a minimal amount of additional code to pull data from amazon and push it into the local store).

b.bum

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSInMemoryStoreType: Not really "persistent", is it?
      • From: Jerry Krinock <email@hidden>
    • Re: NSInMemoryStoreType: Not really "persistent", is it?
      • From: Houdah - ML Pierre Bernard <email@hidden>
    • Re: NSInMemoryStoreType: Not really "persistent", is it?
      • From: Dave Dribin <email@hidden>
References: 
 >NSInMemoryStoreType: Not really "persistent", is it? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Toolbar buttons and isEnabled binding
  • Next by Date: Re: Toolbar buttons and isEnabled binding
  • Previous by thread: NSInMemoryStoreType: Not really "persistent", is it?
  • Next by thread: Re: NSInMemoryStoreType: Not really "persistent", is it?
  • Index(es):
    • Date
    • Thread