• 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: A CoreData Limitation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A CoreData Limitation?


  • Subject: Re: A CoreData Limitation?
  • From: Shawn Erickson <email@hidden>
  • Date: Wed, 18 May 2005 13:31:53 -0700


On May 18, 2005, at 12:19 PM, Raffael Cavallaro wrote:


On May 18, 2005, at 12:12 PM, Bill Bumgarner wrote:

 If you are mutating models on the fly and you aren't creating an application specifically chartered to be creating models, then your model does not sufficiently describe your application's data.

An application "specifically chartered to be creating models" is called a dynamic language runtime. The Objective-C runtime is not flexible enough to allow model modifications at runtime, since by design, Objective-C models are meant to be built using the Objective-C class system, and these classes can only be loaded but not unloaded at runtime.

Don't confuse (at least don't confuse others :-) data modeling with code modeling (classes, class hierarchy, etc.) or overly tie the two together [1]. You can model your data such that you can deal with changes in its structure (with in the limits of what your schema allows for) at runtime without requiring modification at runtime of the code (or bindings or the schema itself).

In fact NSManagedObject is in a way an example of one aspect of this since it can represent any arbitrary object in your applications object graph at runtime and it (obvious at the hands of the managed context) does so based on what your schema defines. Additionally dynamic modification of binding paths, etc. at runtime gives you additional abilities however good schema design can avoid having to do such things. 

One way to think of it is that in your schema you should model not only your application data but also how its structure could be modified at runtime (just another piece of data to model). In other words don't add a property to an entity (aka column to a table) in your schema at runtime instead define your schema such that you can capture that additional data and relate it as needed (could be a simple as table that captures named or unnamed attributes that can be related to other objects in the schema).

Of course how flexible your schema is needs to balanced against how complex you want it and how likely schema changes are, etc. It isn't an exact science.

FYI it is known that the Apple's Objective-C runtime is getting closer to allowing for unloading of classes at runtime [2]. Also GC is being worked on for Apple's Objective-C runtime [3].

-Shawn

[1] Sure you could use a dynamic language runtime to also address this but you still have similar issues to deal with let alone how to persist the data in an format such that you can understand what it contains, etc.
[2] <http://lists.apple.com/archives/objc-language/2005/May/msg00015.html>
[3] <http://lists.apple.com/archives/objc-language/2005/May/msg00028.html>

 _______________________________________________
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: A CoreData Limitation?
      • From: Raffael Cavallaro <email@hidden>
References: 
 >Re: A CoreData Limitation? (From: Bill Bumgarner <email@hidden>)
 >Re: A CoreData Limitation? (From: Arthur Schuster <email@hidden>)
 >Re: A CoreData Limitation? (From: Raffael Cavallaro <email@hidden>)
 >Re: A CoreData Limitation? (From: Bill Bumgarner <email@hidden>)
 >Re: A CoreData Limitation? (From: Raffael Cavallaro <email@hidden>)

  • Prev by Date: Re: Cocoa Bindings + User Defaults Controller Trouble
  • Next by Date: Re: SIMPLE way to pass Objects over a network
  • Previous by thread: Objective-C & dynamism (was Re: A CoreData Limitation?)
  • Next by thread: Re: A CoreData Limitation?
  • Index(es):
    • Date
    • Thread