I am unsure about the correct definition of transient properties:
- One can define transient properties in the object model and then calculate them when needed in the related class.
- But things work just as well if you specify a class and define arbitrary getter methods for any transient property without declaring it in the object model (as long as the entity is linked to that class in the model).
My question: What is the benefit of declaring transient properties in the object model? I only see one down-side: each time you add a transient property (e.g. "FormattedDate") the persistentStore becomes incompatible.
what am I missing?
From the Core Data Programming Guide:
I take this to mean "convenience" and "keeping all your attributes defined in one place - the Managed Object Model".
As for MOM versioning, the Core Data Model Versioning and Data Migration Programming Guide says:
It doesn't clarify its position on transient properties, however. In fact the second bullet point elaborating that paragraph almost sounds like a contradiction. A quick test (new project with a simple "Foo" entity with a "name" attribute, save a file with several foos, add a transient property, run again, and the foos all load, add a new foo, save, close, re-open) shows transient properties in fact are not considered by the versioning system.