data binding - howto avoid massive notification in DataBinding -
I think this is a common problem in the database scenario. If you are running a batch update and you want to avoid, what do you usually do, depending on the assets executed for each one update-dependency calculation / action / whatever?
The first thing that usually comes to my mind
- They introduce a new bullion or hook the event holder ...
I do not like about this approach:
- (It has to be maintained ...)
- They are error prone, because you make sure That a suppressive notifications are sent later
I am thinking if anyone has already given this problem a more convenient Be addressed, which is easier to handle?
Tia Martin
Edit: Do not let me down. I know about things. Knowing things from the listing list, such as the Wiselist changed event ... they are addressing all the problems in the same way I said, but I am searching in a different way whose deficiencies are not listed. Maybe I'm on the wrong track, but although I give it a try here ...
Unfortunately there is not a single-size-fit-all solution. I have applied or seen the following solutions:
-
There are two singles, a signal is emitted when the change occurs with the user's action, the second always sets a fire. This code allows to differentiate between changes in UI and updates.
-
A boolean to protect the code
-
Property event
- < P> Freeze / glowing method on signal or signal manager (i.e. whole framework)
-
The signal is merged in the same One way to do this, you can update N and they are collected in the M signal where M & L; = N. If you change the same property 100 times, you still get 1 signal.
-
The signals (instead of synchronous execution) can also merge the queuing code signal, I have used it in this application with great success, in which the "save" button Not all changes are saved in the database as you make them. When you change a text, the changes are merged with a certain time (as long as the last DB update returns) and then, they are committed as a single change.
-
To set up multiple values once; Only one signal is emitted.
-
The signals can send signals to different levels of granularity. Say you have a name person when you change the name, you get two signals: one to change the name and an "instance field changed" So if you only look at "something has changed" So you can hook in the example instead of all the fields.
Comments
Post a Comment