Learning about Core Data (was Re: Bindings question for core data application)
Learning about Core Data (was Re: Bindings question for core data application)
- Subject: Learning about Core Data (was Re: Bindings question for core data application)
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 5 Apr 2006 02:16:04 -0700
On Apr 5, 2006, at 12:06 AM, Wayne Pascoe wrote:
I felt that core data might be relevant as I am using entity's with
a mix of attributes and relationships. I don't understand the
internals of this well enough to know if this does or does not make
a difference to the bindings solution,
This is a point worth making generally (so thanks to Wayne for giving
a launching point):
A large proportion of the questions asked on this list that purport
to be "about Core Data" are actually not specific to Core Data at
all, but are instead generic either to Cocoa data management and
application design or to Cocoa bindings.
Core Data and Cocoa bindings are orthogonal (if complementary)
technologies.
First, it is important to bear in mind that Core Data objects are
still just objects, and have little influence on the user interface
parts of your application simply by virtue of being Core Data
objects. The Low-Level Core Data tutorial <http://
developer.apple.com/documentation/Cocoa/Conceptual/
CoreDataUtilityTutorial/index.html> shows that it's not necessary for
Core Data to use any graphical user interface at all. There are
typically only a few isolated cases where using Core Data may make a
difference if used in conjunction with bindings (such as if for a
controller you don't bind the managed object context, or incorrectly
specify an entity name), and these should be self-evident.
I would personally recommend that most developers not try to learn
Core Data and Cocoa bindings simultaneously. Although they are
independent and address different issues, both technologies provide
abstraction layers that -- whilst individually reasonably
straightforward to grasp -- combined can be challenging to master.
Moreover, as the Core Data Programming Guide notes:
"Core Data is not an entry-level technology. It leverages many other
Cocoa technologies, including memory management, key-value coding,
and key-value observing. You must understand these technologies to
use Core Data effectively. You also need a solid understanding of
data modeling and the model-view-controller design pattern as it
pertains to Cocoa."
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdBasics.html#//apple_ref/doc/uid/TP40001650-
DontLinkElementID_9>
Note that key-value coding and key-value observing underpin both Core
Data and Cocoa bindings, so it is valuable to gain a solid
understanding of them. These documents should be considered required
reading before learning about either technology:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
KeyValueCoding/index.html>
<http://developer.apple.com/documentation/Cocoa/Conceptual/
KeyValueObserving/index.html>
I would suggest that anyone wanting to learn Core Data should first
ensure that they properly understand the terminology used by reading
"Object Modeling" <http://developer.apple.com/documentation/Cocoa/
Conceptual/CocoaFundamentals/CocoaDesignPatterns/
chapter_5_section_5.html>, then review the key-value documents
previously mentioned.
Start your investigation of Core Data by reading the overviews at
<http://developer.apple.com/macosx/coredata.html> and <http://
developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/
cdBasics.html>
then study and understand the Low-Level Core Data tutorial (op. cit.)
to gain an appreciation of the different components of the framework
without the distraction of a user interface. Next, try creating
another more complex application (using, say, two related entities)
again without a user interface.
At this time you should read the Predicates Programming Guide <http://
developer.apple.com/documentation/Cocoa/Conceptual/Predicates/
index.html> (if it isn't clear why, it should be by the time you've
gone through the preceding).
Do not attempt the NSPeristentDocument tutorial unless you do already
understand bindings (see the "Important" note at <http://
developer.apple.com/documentation/Cocoa/Conceptual/
NSPersistentDocumentTutorial/00_Introduction/
chapter_1_section_1.html>). If you're not already comfortable with
bindings, work through the various online tutorials etc. In
addition, you should ensure that you are familiar with not only the
general (and oft-cited) Model-View-Controller design pattern, but
also with the Mediator pattern described at <http://
developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/
CocoaDesignPatterns/chapter_5_section_3.html#//apple_ref/doc/uid/
TP40002974-CH6-SW28>.
Once you are comfortable with bindings, watch the ADC video at
<http://developer.apple.com/cocoa/coredatatutorial/index.html> then
work through the NSPeristentDocument tutorial (op. cit.). When
specific areas need greater explanation, refer to the Core Data
Programming Guide <http://developer.apple.com/documentation/Cocoa/
Conceptual/CoreData/index.html>. If you need more detail about an
aspect of Core Data that is not covered by the Guide, please file an
enhancement request <http://bugreport.apple.com>.
mmalc
_______________________________________________
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