O'Reilly logo
  • Li Xie thinks this is interesting:

What do YOU think about this design?


Cover of Head First Design Patterns


I feel you can still handle it by adding a few intermediate classes if there is only one behavior to change. However, if there are more, the combination would be a nightmare to maintain. Consider one subclass for each fly+quack combination. You are doing strategy in a hard way.