[DUG] Discussion & Donation
Todd Martin
toddm at kol.co.nz
Mon May 15 12:03:33 NZST 2006
Hi Carl
Yes. I did use interfaces to decouple to objects, but that actually doesn't
help a lot, because you still need to write the implementation code for each
object that implements the broadcaster/observer interfaces. What a pain!
Is you name spelt with a "C" or a "K"?
I suggest an enumerated type....snigger.
Todd.
----- Original Message -----
From: "Karl @ Work" <karlreynolds at xtra.co.nz>
To: "'NZ Borland Developers Group - Delphi List'" <delphi at ns3.123.co.nz>
Sent: Monday, May 15, 2006 11:38 AM
Subject: RE: [DUG] Discussion & Donation
> >I have implemented the observer pattern previously with the lists
> maintained internally by the objects involved, so removing the need to
> inherit from a particular class is a great improvement
>
> That is what interfaces were made for. Create an interface for receiving
a
> type of broadcast notification, and support it in the object types that
you
> want to be able to receive such. Your notifier's lists of different types
> of listeners can become a single list of interfaces, and hence your
notifier
> can broadcast to the interface methods without worrying about what types
of
> objects it is dealing with, requiring them to inherit from particular
> ancestors, or having to do TMethod casts (which provide little flexibility
> anyway since target method parameters still have to conform to those of
the
> broadcaster).
>
> Cheers,
> Carl
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
>
>
> --
> Internal Virus Database is out-of-date.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.5.1/327 - Release Date: 28/04/2006
>
>
--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.5.1/327 - Release Date: 28/04/2006
More information about the Delphi
mailing list