I find transient attributes extremely useful sometimes for properties which you want in the undo stack, but not persisted to disk. For example data caches, or session-specific UI properties.

Mike.

On 20 May 2009, at 04:20, Jerry Krinock wrote:

After working through another issue caused by my use of a transient property, I just searched the whole Core Data Programming Guide for "transient".

I found four disadvantages of using transient properties vs. one advantage. The advantage is not having to write custom accessor methods to support non-standard data types.

So my conclusion is that it is a design mistake to make "Transient" an attribute which is of a standard data type. You get no advantages -- only headaches, possible bugs, and "gotchas" when you switch from XML to SQLite store.

Have I missed anything?

Jerry Krinock


(*) Here are the four disadvantages:

... you cannot fetch using a predicate based on transient properties...

... you cannot sort on transient properties using the SQLite store...

... with transformable attributes you specify just one attribute and the conversion is handled automatically. In contrast, with transient properties you specify two attributes and
you have to write code to perform the conversion.

... If you use refreshObject:mergeChanges: with the mergeChanges flag YES, then any transient properties are restored to their pre- refresh value after awakeFromFetch is invoked. This means that, if you have a transient property with a value that depends on a property that is refreshed, the transient value may become out of sync.




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to