[fpc-pascal] Re: Design Patterns Questions

bsquared bwcode4u at gmail.com
Sun Oct 28 17:42:02 CET 2012


On 10/28/2012 09:34 AM, Michael Van Canneyt wrote:
> 
> 
> On Sun, 28 Oct 2012, bsquared wrote:
> 
>> Hi all,
>>
>> It has been some time since I have used FPC/Laz.  I was looking for some
>> information on 'observer pattern' the other day, and I found this
>> article[1].  I notice that it is a bit old, and it makes me question
>> whether or not I have made an error following it.
>>
>> I get an invalid cast error at this code
>>   (DigitalClock1 as ISubject).Attach(fClockTimer as IObserver);
>> which is actually flipped and should be
>>   (fClockTimer as ISubject).Attach(DigitalClock1 as IObserver);
>>
>> So, my questions ...
>>  Is the article out of date?
>>  Are these patterns implemented in the base code?
> 
> The observer pattern is implemented in tiOPF.
> 
>>  And as an aside, what is the state of tiOPF, I could not get it to
>>  install in Lazarus 1.02.
> 
> Version 3 is designed to work with Delphi 2009 and higher.
> Graeme Geldenhuys actively maintains tiOPF version 2. It works
> definitely with Lazars 1.0.2, I use it myself.
> 
> Michael.
> _______________________________________________
> fpc-pascal maillist  - 
> fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> 
Thank you for responding.  I thought I recalled a stipulation for
version 3.  I noticed it had an Compilers/FPC folder, so I hoped it was
compatible.

Having trouble getting V2 demos to work.  Have to keep at it.

-- 
Regards,
Brian




More information about the fpc-pascal mailing list