The Laws of Core Data
davedelong.com
davedelong.com
It does have a persistence layer, but it is not it’s persistence layer.
See https://nshipster.com/core-data-libraries-and-utilities/
> Contrary to popular belief, Core Data is not an Object-Relational Mapper, but rather an object graph and persistence framework [...] Using Core Data as an ORM necessarily limits the capabilities of Core Data and muddies its conceptual purity. But for many developers longing for the familiarity of an ORM, this trade-off is a deal at twice the price!
Edit: should have read the post before replying to comments ^^’
> Many of the core concepts of EOF re-emerged as part of Core Data, which further abstracts the underlying data formats to allow it to be based on non-SQL stores.
Apple also released CloudKit which synchronizes with FoundationDB’s Record Layer making Core Data an alternative to Google Firebase and Amazon’s GraphQL based AppSync.
It is an object oriented approach to data access which many developers prefer while others dislike. SQLDelight [2] is a YeSQL-like alternative for the anti-ORM and anti-Vendor-Lock-In folks but it relies on Multiplatform Kotlin to support both Apple and Android ecosystems.
Engineering is about managing trade-offs given a set of constraints. Core Data is sometimes a fine choice.
[1] https://en.wikipedia.org/wiki/Enterprise_Objects_Framework
If anything I would argue it’s the other way round; the API is designed first and foremost for internal clients which creates quite a burden of complexity and nuance for third-party clients to come up to speed.
I think the tough thing for Core Data is that it’s effectively a big caching layer and whilst that brings great performance benefits if you understand how and why it does what it does, it also brings a level of complexity and confusion if you don’t.
Having said that, its API is starting to show its age in this new era of type-safety.
ORMs are great for quick and easy prototyping. But in no way I would ever use another ORM in any application again. Simple helpers like Dapper (C#/.NET) are fine. But nothing more than that.
Learn SQL and handle it yourself. You will be thankful sooner or later.
One thing that people get confused with about CoreData is treating it like an ORM; it is not. CoreData is an object persistence framework more in line with object databases than relational databases. The ability to use SQLite is just an implementation detail. It's like how Datomic can use a SQL db as a datastore however does not present data relationally.
When porting apps back and forth between Android and iOS, the biggest thing I miss on Android is CoreData. CoreData is exceptional at what it does and its a shame that more iOS education doesn't focus more on CoreData.
This article is very much worth reading.
Ok; I get that point from you. but the article says it's not a database, and that it is, in fact,
> "Core Data is an “object graph and persistence framework”, which is basically like a fancy kind of object-relational mapping. "
So I'm confused by everything in the article and the comments.
In hindsight I wish I would have learned Core Data instead.
*If your app manages huge amounts of records on the device, then it might be worth it. But that’s not what many apps use Core Data for. Many apps use it to cache bits of data from the server and other local state. You don’t need a full blown ORM / database for this. Instead of wasting your time learning the obtuse Laws of Core Data, model your app state with some nice Codable structs, write it to disk, and then take the afternoon off.
It's a thin wrapper around SQLite, with convenience APIs for record types, robust support for concurrency, and a focus on GUI apps.
I don't know or use it personally. But the developer behind it is very experienced and sells the nice, tried and true image editor Acorn here. https://flyingmeat.com
Very different trade-offs. Focusing on separating mutations out and provide change subscription mechanism to facilitate one-way data flow UI design.
In terms of usability it was lightyears ahead of Core Data, and it actually worked smoothly with multi-threaded apps without breaking down constantly (as had been our experience with Core Data). It was a joy to work with.