Core Data objects can be retrieved by using an NSFetchRequest
or by following relationships with other objects in the graph. Is it fair to say that in a well designed model will contain sufficient relationships (and fetched properties) such that the use of NSFetchRequests
are kept to a minimum?
The counter argument is that in iOS there exists NSFetchedRequestController
. Presumably if Apple believed that relationships and fetched properties provided satisfactory performance with the existing faulting/caching they would not have created NSFetchedRequestController
.
There are instances when using an NSFetchRequest
are superior as Core Data can do all the work within SQLite. An example would be fetching aggregate values.
Any thoughts on this? I've had a look at the Core Data Programming Guide. There's relevant advice in the 'Fetching Managed Objects' and 'Core Data Performance' sections, but nothing to strongly suggest relationships over fetch requests or vice versa.