K
Kai-Uwe Bux
James said:You've got it backwards. Why do you want to encumber all the
rest of the Shapes with something that is only relevant to
Squares?
I think what Daniel is getting at is that you shouldn't have to know whether
your request is only relevant to Squares. You should just notify all
objects in your collection that a certain condition obtains and those
objects will decide autonomously whether they have to respond. It might
happen (somewhat by accident) that only Squares feel the need to react, but
that is nothing that client code should need to care about. In other words,
if you find yourself dealing with a collection of objects and you want to
send notifications that cannot be _understood_ by all objects in the
collection, then there is something fishy. However, not all objects that
understand the message need to react in the same way (or even react at
all).
Best
Kai-Uwe Bux