>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
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to