[fpc-pascal] Design Patterns Questions

Ewald bloody.middlefinger at yellowcouch.org
Sun Oct 28 16:41:53 CET 2012


You might find some info on the list archive for fpc-devel:
http://lists.freepascal.org/lists/fpc-devel/2012-October/030149.html

--
Ewald

On 10/28/2012 04:09 PM, 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?
>   And as an aside, what is the state of tiOPF, I could not get it to
>   install in Lazarus 1.02.
>
> Thank you.
>
> [1] -  http://blogs.teamb.com/joannacarter/2004/06/30/690




More information about the fpc-pascal mailing list