The QuackCounter is a Quackable too. When we change Quackable to extend QuackObservable, we have to change every class that implements Quackable, including QuackCounter:
Sharpen your pencil
What if our Quackologist wants to observe an entire flock? What does that mean anyway? Think about it like this: if we observe a composite, then we’re observing everything in the composite. So, when you register with a flock, the flock composite makes sure you get registered with all its children, which may include other flocks.
Sharpen your pencil
We’re still directly instantiating Geese by relying on concrete classes. Can you write an Abstract Factory for Geese? How should it handle creating “goose ducks?”
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.