← Back to Upcase

Decorator and Duck Typing


(Nicholai de Guzman) #1

This article was great in reviewing polymorphism in Ruby.

Is there a more in-depth discussion on Upcase or elsewhere that discusses when to use Decorators and Duck Typing? In the article referenced above, the goal of duck typing seems opposite to the decorator: in duck-typing, we are trying to be more generic, but in decorators, a more specific class uses a generic class’ method.

Thanks!