[fpc-pascal] Re: New multicast event implementation
Ben
ben.smith.lists at gmail.com
Thu Feb 3 08:16:32 CET 2011
Op 2011-02-02 15:55, Anthony Walter het geskryf:
> isn't effecting the print version. The workaround is that you can print
> the code blocks by clicking the print icon in each code section. I'll
> fix it later.
I simply used the Browser's Print menu option, instead of the "printer
friendly webpage option", and that worked fine for my needs.
> Regarding the observer pattern, I'll refer you to this stack overflow
> question:
>
> http://stackoverflow.com/questions/550785/c-events-or-an-observer-interface-pros-cons
>
> My take is that event are more natural and that they are probably more
> well established than the pattern of creating an interface to subscribe
Regarding that stackoverlflow question. That is highly dependant on how
you implemented the observer in your BOM. Years ago, I implemented a
observer via Interfaces in our Object Pascal code, where I could observe
just the fields of a class I was interested in. No generics required,
just a plain observer implementation using a InterfaceList - by creating
a base BOM class which all your other BO descend from.
I'm not saying your idea or implementation is bad - though personally I
have never had the need to use generics yet (and it seems neither has
many others - good or bad language feature, I don't know?). I'm just
pointing out that there are multiple ways of doing the same thing.
Observer could very easily be used too, and without the pitfalls listed
in the Stack Overflow article.
--
Ben.
More information about the fpc-pascal
mailing list