Re: ADC Core Data article
Re: ADC Core Data article
- Subject: Re: ADC Core Data article
- From: Philippe Mougin <email@hidden>
- Date: Fri, 8 Apr 2005 16:52:25 +0200
mmalcolm crawford wrote:
> The article states, "The NSManagedObject class implements
> the functionality needed to fully integrate into the Core
> Data framework and can represent any entity. It acts as a
> dictionary in that any of its attributes and relationships
> can be set using Key-Value Coding (KVC) as well as observed
> using Key-Value Observing (KVO)."
A cool thing about NSManagedObject (assuming it is like
EOGenericRecord) is that you get a default implementation of your model
objects for free once you have specified your entity-relationship model
with the design tools (or programmatically).
But the question, or the critic, is: why is this default interface for
managed objects something that is dictionary-oriented instead of
object-oriented? Something that we have to access using KVC, which, as
others have pointed out, is ugly, not checked at compile-time, slow,
consists in fact in using a new little embedded language etc., instead
of a normal object-oriented interface that we could use directly
through messaging (which is natively supported by Objective-C)?
Sure, we can subclass NSManagedObject and add accessors ourselves, but
why do we have to do it? Why is this not the default interface provided
by Core Data for free?
That being said, let me add that:
- There might be perfectly good reasons that would answer my questions
(in such case I would be interested to know about them!)
- From what I've seen of Core Data, it seems to be a great technology
and a very nice addition to Cocoa.
Best,
Philippe Mougin
Open source scripting layer for Cocoa: http://www.fscript.org
_______________________________________________
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