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

  • SEARCH
  • Home
  • 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 5945907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:44:51+00:00 2026-05-22T16:44:51+00:00

I have an app I am working on, and it has a number of

  • 0

I have an app I am working on, and it has a number of pieces of data that are interdependent. Basically, I have a set of number fields that are used to calculate other number fields, which are then used to calculate other fields. I am trying to determine the best way to handle the potentially large number of changes.

One solution I thought of is that I could override the setters of the values that can be modified by the user to do the calculations and then update the other values in data object appropriately. The largest downside to this is the sheer amount of (somewhat boilerplate) code that needs to be written.

Another solution I thought of is using Key-Value Observing to handle the data changes, and to then update the dependent values from those changes. Note that none of the dependent values will ever update except when an independent value updates. While I think this will be a bit more elegant, I am concerned about potential performance problems, or problems that I am possibly not considering.

Is there a third way that I am missing? Are there any best practices for this type of work? I know that I am likely going to have to write a bunch of boilerplate code of some sort – I would like the code to be the easiest to maintain, and the smallest amount of code possible.

  • 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-22T16:44:52+00:00Added an answer on May 22, 2026 at 4:44 pm

    KVO shouldn’t have any performance issues unless you have very many fields or very frequent updates, but its API isn’t the greatest. One downside is that it funnels all notifications through a single method. This may or may not be an issue depending on your number and types of fields.

    Notifications might also be a good option. Each field could have a notification name that it would post changes from, and other fields could observe without an explicit pointer to the source field.

    There is also delegation with protocols which, while simpler and more performant, can be rather boilerplate-heavy depending on how you do it.

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

Sidebar

Related Questions

I'm working on an SEO app that (among other things) shows the number of
I have a core data based app I am working on, that uses an
I have a number of EditText fields on an Android app and I've used
I'm working on an app that has an ItemListView that contains a number of
I have my php app working fine, performing some other Graph API functions. However,
I have an Android app that I had working a few months ago which
I'm working on an app that has rows in the following format. I've numbered
I am currently working on a app that has multi web browsers on a
I'm working on a iPhone app which has a pretty large UITableView with data
I have a Rails app that processes a large (millions) number of records in

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.