• 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: Using CoreData as disconnected cache (Populating CoreData programmatically)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using CoreData as disconnected cache (Populating CoreData programmatically)


  • Subject: Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
  • From: Alexander Lamb <email@hidden>
  • Date: Thu, 12 Oct 2006 17:31:42 +0200

Hello,

What you are trying to do is interesting... since I am looking into this as well I was wondering how you were going to handle updates.

1) From client to server.

Since you first write to your local data store (as if the programme is actually single user), it means somewhere you will need to tell the app "push updates to the server". You can't send the complete local database each time. Also, since it will (probably) be asynchronous from the user data entry, how will you handle collisions on the server. Who is correct? The last one saving?

2) From server to client.

From what I understand, the client basically says "give me a subset of the data". How does he specify the subset? Depending on the subset, you might pull out most of the database (be aware of deep copying objects).
Also, even if you get your subset, you then are disconnected. How do you notify your client that some data he copied has changed on the server?


Finally, is your server CoreData based or is it a more traditional database server and you will be running sql directly to get the data and update it (are you going through an application server or directly to the data)?

Thanks,

Alex
--
Alexander Lamb
email@hidden



On Oct 11, 2006, at 8:18 PM, Andrew Satori wrote:

You know, sometimes all it takes is a prod :-). Thanks Chris, that's exactly what I needed. A quick test and it works like a charm.

Andy

On Oct 11, 2006, at 2:05 PM, Chris Hanson wrote:

On Oct 11, 2006, at 9:22 AM, Andrew Satori wrote:

So in order to test this, I've started with the import, and I'm already stuck. I cannot seem to find any examples of how to add data to a coredata model programmatically. I can find CoreData with bindings examples everywhere, but nothing about doing this in code, and I'm looking for some direction to look for more information on the subject.

What documentation have you looked at? The Low-Level Core Data Tutorial <http://developer.apple.com/documentation/Cocoa/ Conceptual/CoreDataUtilityTutorial/> and the Core Data reference documentation should tell you what you need to know about working with Core Data persistent stores programmatically.


Also — and I know I mention this in practically every other message on the subject — it's important to use correct terminology to think about the problem as it will make both finding answers to your questions and designing your application a lot easier. I'm specifically referring to your "add data to a coredata model" statement. You actually insert managed objects into a managed object context that is connected to a persistent store coordinator with any number of persistent stores added to it, and ask the managed object context to save the changes you've made to your object graph.

The terminology in the preceding paragraph directly mirrors the names of the classes you'll need to deal with and the operations you'll need to ask them to perform. Sometimes developers familiar with Core Data will speak in shorthand, e.g. "context" instead of "managed object context" and "coordinator" or "store" instead of "persistent store coordinator" or "persistent store" but by and large if you stick to the terms used by the classes, the path to the solution can sometimes practically chart itself.

  -- Chris


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
      • From: Andrew Satori <email@hidden>
References: 
 >Using CoreData as disconnected cache (Populating CoreData programmatically) (From: Andrew Satori <email@hidden>)
 >Re: Using CoreData as disconnected cache (Populating CoreData programmatically) (From: Chris Hanson <email@hidden>)
 >Re: Using CoreData as disconnected cache (Populating CoreData programmatically) (From: Andrew Satori <email@hidden>)

  • Prev by Date: Re: https upload/download with users and passwords
  • Next by Date: Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
  • Previous by thread: Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
  • Next by thread: Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
  • Index(es):
    • Date
    • Thread