Hi Delphi XE2 TComponent has a new "Observers" property. Unfortunately the help entries for this are empty. Does anybody know what this new property is good for and how to use it? Edit: Well i know that it is related to LiveBindings, but I would love to know a bit more about it, and since I have no access to XE2 source code, I can't investigate myself.
-
1[Stefan Glienke](http://stackoverflow.com/users/587106/stefan-glienke) has also a blog post mentioning the `implemention of the observer pattern into TComponent` in Delphi XE2 [here](http://delphisorcery.blogspot.com/2011/09/dharp-bindings-vs-livebindings.html). – menjaraz Feb 26 '12 at 08:04
3 Answers
The Delphi XE7 documentation now goes much deeper into the details of the Observers:
Observers is a read-only property that returns the TObservers added to the TComponent, in order to use the notifications provided by the observers either with LiveBindings or for the developers' own purposes.
Note that the Observer in Fringe can be seen on the scene of many Pattern-related events.
Side note:
Observers might also be able to detect situations where a EProgrammerNotFound exception must be thrown by the RTL.
It is related to LiveBindings. A rather cool but extensive subject, explained in the new DocWiki for XE2.

- 28,387
- 5
- 46
- 94
-
2sorry Rudy, but the DocWiki isn't really helpful with respect to my question. I am quite aware of LiveBindings, but have my problems really understanding what's behind them, and how they are implemented. Therefore the background of my question is how they are related to LiveBindings. – iamjoosy Sep 02 '11 at 22:36
-
2Hmmm... I see that, indeed, the role of the observer is not explained. I guess I'll remove my answer in a while. – Rudy Velthuis Sep 02 '11 at 22:52
-
1"Therefore the background of my question is how they are related to LiveBindings." If that is the case, it would have helped to put that information in your question. – GolezTrol Nov 06 '11 at 14:06
The Delphi implementation of the observer pattern is explained here:
http://blogs.teamb.com/joannacarter/2004/06/30/690
I'll update the answer with more details as soon as I've had a chance to look at the source code.

- 74,508
- 24
- 191
- 319
-
2This is interesting but it seems to be unrelated to the new TComponent.Observers property – mjn Sep 10 '14 at 12:58