We could add code to attach, detach, and notify observers to each of the concrete
quacker
elements. However, that seems to be pretty messy. We could create an abstract class that each
of the quackers would inherit from. This is a possibility, but we know that we'd like to avoid
inheritance if possible, especially for something like this. Let's create a delegate class and change
the constructors to accept the delegate. This is pretty easy to do since we're using factories to
create the quackers.
We also need to add calls to notify in the quack() methods so that if there are any
observers, they'll
know that a quack occurred. Our system now looks like this (yes, it's getting pretty complex).