• 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: ADC Core Data article
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ADC Core Data article


  • Subject: Re: ADC Core Data article
  • From: Ralph Scheuer <email@hidden>
  • Date: Fri, 8 Apr 2005 17:28:35 +0200

Phillippe,

Am 08.04.2005 um 16:52 schrieb Philippe Mougin:

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)?

what's your question? If you take a closer look at EOF, the situation is quite clear: we are talking about data objects here, and you deal with them like this: you either use KVC on the EOGenericRecord (NSManagedObject) OR you subclass and add accessor methods and custom logic.


How else should the whole thing be object oriented? The subclass provides iVars (and accessors) for the data structure that is represented by the Entity / SQL Table / whatever is being mapped to the object, so you will basically HAVE to subclass if you need to use accessors, don't you? Let me give you an example:

In WO (Java), I have a Customer entity that is an EOGenericRecord subclass. This class contains firstName and lastName iVars with appropriate accessor methods. Question: if you did not subclass here, where can the appropriate accessor

setLastName(String newLastName) and lastName() come from?

For a WO developer, it is quite clear that YOU either have to provide those iVars or use KVC, there is no alternative.

Maybe my thinking is too much wrapped around WO, but I could not think of another way to do it in this case... What's the alternative, Phillippe?

Ralph

_______________________________________________
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


References: 
 >Re: ADC Core Data article (From: Philippe Mougin <email@hidden>)

  • Prev by Date: Re: ADC Core Data article
  • Next by Date: Re: ADC Core Data article
  • Previous by thread: Re: ADC Core Data article
  • Next by thread: Re: ADC Core Data article
  • Index(es):
    • Date
    • Thread