Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Live Binding with Automatic updates in XE3 (no need to call Notify() as in XE2)

I am currently using Delphi XE2, and heard about their new Live Binding with Automatic updates in XE3 (no need to call Notify() as in XE2).

in C# or in Delphi XE2 we have to implement INotifyPropertyChanged (Notify(); in Delphi), and this approach really makes sense as we have full control over the contents to be updated and when to update it so we can fine tune the performance and implement virtualization easily.

But I just want to know how does it works, what kind of mechanism they have done in order to implement it, and i have no clue how they have did it, following are the assumptions may have used to implement Automatic updates.

  1. Timer : A timer tick frequently and refreshes all the data

    Very slow performance no virtualization

  2. Compiler Level Feature : All the notify() events related codes implemented by the compiler auto-magically

    Lots of over heads

  3. Somme other Approach:

Please help me to identified how they have implemented it.

I am currently using XE3 trial so i don't have access to the source code, your answers will help me decide whether to switch to new features or not.
I have a class(collection item) with 400 properties to bind(Not all of them all the time), so the performance really plays a major role in the stability of my application.

like image 550
VibeeshanRC Avatar asked Sep 30 '12 03:09

VibeeshanRC


1 Answers

LiveBindings happen by binding any object with another object of interest based on some events. This happens by an observer pattern, when there is event trigger, the object inspector will be notified and the inspector will notify the already registered components to display the changes.

Hope this helps. There is lot of documentation for this if you want to dig around.

like image 104
jamb Avatar answered Sep 19 '22 07:09

jamb