First page Back Continue Last page Graphics
Handling Varying Behaviors
Solution: take what varies and “encapsulate” it
- Since fly() and quack() vary across ducks, separate these behaviors from the Duck class and create a new set of classes to represent each behavior