[fpc-pascal] IFPObserved

Xiangrong Fang xrfang at gmail.com
Wed Sep 11 09:40:58 CEST 2013


Hi Michael,

Thanks a lot for the explanation.   I am not familiar with a few concepts
in your description, such as:

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?

2) Why an interface has "reference count"?

3) What are "Live Binding"?  What's the difference between "IFPObserved"
and the component events like OnCreate, OnShow, OnClick...?

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?

5) I am very interested in your CD-Cover designer. please send me the
article and code.

Thank you!



2013/9/11 Michael Van Canneyt <michael at freepascal.org>

>
>
> On Wed, 11 Sep 2013, Xiangrong Fang wrote:
>
>  Hi All,
>>
>> Where can I find detailed documentation on IFPObserved?  This page only
>> defines the interface but not telling about the purpose of this interface:
>>
>> http://www.freepascal.org/**docs-html/rtl/classes/**ifpobserved.html<http://www.freepascal.org/docs-html/rtl/classes/ifpobserved.html>
>>
>> My questions are:
>>
>> - what is this interface for?
>>
>
> There are 2 interfaces: IFPObserved and IFPObserver. Together they form
> the observer pattern that can be used to implement the mediator pattern.
>
> Basically, if an object wants to notify other observers that it 'has
> changed', it implements the IFPObserved interface.
> 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.
>
> An object that wishes to be notified by other objects that they have
> changed, implements the IFPObserver pattern.
> It must implement 1 method which will get called whenever an object that
> it is observing, changes.
>
> Both interfaces are CORBA interfaces, so they do not have the burden of
> reference counting.
>
>
>  - any example on when and why to use it?
>>
>
> The fpobserver.pp unit contains an implementation of a mediator and a
> mediator registry.
>
> This could be used for example to implement the Live Bindings of
> Embarcadero in a rather trivial manner.
>
>
>  - 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?
>>
>
> I have a complete CD-Cover design program somewhere, which is written with
> this technology;
> 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.
>
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130911/a8ff4cc5/attachment.html>


More information about the fpc-pascal mailing list