My application has a UI for settings which is a mixture of textboxes and scrollbars with which users can interact. I have created a class for thisthese settings and create aan object to store them. UserThe user can also give command line arguments to apply settingsettings from a file as well.
I have a function that loads this data into the UI from the object (i.e read from a file) and have another function that changes object data when user make changes to the UI. So here is where the
My problem is: if I load the data from file into UI, the function responsible to makereflect these changes in the UI fires up but the other function also fires up because changes were made to the UI.
So what should I do to overcome this? shouldShould I implement some kind of state mechanism that would tell code that user has made the changes., or setup some flag which will tellmark that the data is loaded from a file. If you can suggest some design patterns to follow?