<div dir="ltr"><div><div><div><div><div><div><div>Hi Michael,<br><br></div>Thanks a lot for the explanation. I am not familiar with a few concepts in your description, such as:<br><br></div>1) What are "CORBA" style interfaces? I know CORBA and DCOM are for distributed or remote object call. Are they still significant in local object system? <br>
<br></div>2) Why an interface has "reference count"?<br><br></div>3) What are "Live Binding"? What's the difference between "IFPObserved" and the component events like OnCreate, OnShow, OnClick...?<br>
<br></div>4) You mentioned "implement the Live Bindings of Embarcadero in a rather trivial manner", does that mean IFPObserved is a FPC/Lazarus feature which is not compatible with Delphi?<br><br></div>5) I am very interested in your CD-Cover designer. please send me the article and code.<br>
<br></div>Thank you!<br><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/11 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
On Wed, 11 Sep 2013, Xiangrong Fang wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<br>
<br>
Where can I find detailed documentation on IFPObserved? This page only defines the interface but not telling about the purpose of this interface:<br>
<br>
<a href="http://www.freepascal.org/docs-html/rtl/classes/ifpobserved.html" target="_blank">http://www.freepascal.org/<u></u>docs-html/rtl/classes/<u></u>ifpobserved.html</a><br>
<br>
My questions are:<br>
<br>
- what is this interface for?<br>
</blockquote>
<br></div>
There are 2 interfaces: IFPObserved and IFPObserver. Together they form the observer pattern that can be used to implement the mediator pattern.<br>
<br>
Basically, if an object wants to notify other observers that it 'has changed', it implements the IFPObserved interface.<br>
Since TStrings is a prime candidate for this, IFPObserved has been implemented in TPersistent. This means that any component can act as an observed object. It is up to the component implementation to decide which changes must be communicated.<br>
<br>
An object that wishes to be notified by other objects that they have changed, implements the IFPObserver pattern.<br>
It must implement 1 method which will get called whenever an object that it is observing, changes.<br>
<br>
Both interfaces are CORBA interfaces, so they do not have the burden of reference counting.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- any example on when and why to use it?<br>
</blockquote>
<br></div>
The fpobserver.pp unit contains an implementation of a mediator and a mediator registry.<br>
<br>
This could be used for example to implement the Live Bindings of Embarcadero in a rather trivial manner.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Where can I find documentation that contains explanation on the above 2 questions, so that I can get a "big picture"? For example, if there are any similar interfaces that form the foundation of FCL or LCL? <br>
</blockquote>
<br></div>
I have a complete CD-Cover design program somewhere, which is written with this technology;<br>
I also have somewhere some articles that discuss the design, I will see about publishing them on-line somewhere ASAP. I can send you a copy if you want.<span class="HOEnZb"><font color="#888888"><br>
<br>
Michael.</font></span><br>_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br></blockquote></div><br></div>