Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7073023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:52:47+00:00 2026-05-28T05:52:47+00:00

Is there any reason at all to model a transient attribute for a derived

  • 0

Is there any reason at all to model a transient attribute for a derived property if it is read only? It seems like a lot easier to just declare a property in my customized class and then calculate the value in the getter on fly. I’d combine this with keyPathsForValuesAffecting to inform observers about changes.
If I needed caching I’d just add an ivar for the property and reset it whenever one of the underlying values changes (as suggested in the answer to this question).

Would there be any advantages in modeling this as a transient attribute?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:52:47+00:00Added an answer on May 28, 2026 at 5:52 am

    I was in fact doing this very thing, because of this quote from the Core Data Programming Guide, “Consider an application in which you have a Person entity with attributes firstName and lastName, and a cached transient derived property, fullName”. Which is where I believe I came up with the idea that this would be a good thing.

    However, it goes on to say, “(in practice it might be unlikely that a fullName attribute would be cached, but the example is easy to understand).”, letting me know that this really was just for example of what they were describing but probably not good implementation.

    So, after reading more about transient properties and their intended use, I realized that this is probably a bad way of using them. I am gaining no benefit from having it cached for my implementation. I did like the ability of using ‘dot’ notation (because it’s a property) instead of having to send a message to the object, but I don’t believe there is any performance gain by using it.

    More importantly, I believe the overhead of making it a property that your managed object context must track, actually makes it a bad thing.

    So, I will be refactoring my app to now make these simple instance methods on the sub-class for my managedObject entity and just return the results as I can see no real benefit to making them transient properties.

    The reason to use one of these, is when you actually need to persist something that does not fit one of the managedObject types. But, you then basically create two properties. One that is transient and is the true representation of your object, for which you write getters and setters, and another that is most likely a Binary Data type that is only used internally by the core data entity sub-class for persisting the other objects value(s) in a storage object.

    At least this is my understanding of how this all works. Comments are very welcome if I got any of this wrong as it’s been very confusing to me as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any particular reason that all data members in a class are private
Is there any (technical) reason that C# requires all generic type parameters to be
Is there any reason something like this would not work? This is the logic
Are there any microscopic reasons at all (beyond superstition), to add an extra return
Is there any reasons why PHP's json_encode function does not escape all JSON control
Is there any reason not to use the bitwise operators &, |, and ^
Is there any reason why I should pick JSON over XML, or vice-versa if
Is there any reason to use a varchar field instead of a date field
Is there any reason to start a GUI program (application for Windows) written in
Is there any reason for the use of 'T' in generics? Is it some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.