tcorral / Design-Patterns-in-Javascript

Design Patterns applied to Javascript code.
http://tcorral.github.com/Design-Patterns-in-Javascript/
2.63k stars 528 forks source link

strategy\4\duck.js #4

Closed GarethElms closed 13 years ago

GarethElms commented 13 years ago

A minor observation. In strategy\4\Duck.js. The setFlyBehavior() and set QuackBehavior() aren't called anywhere and also don't do what their names suggest. They can probably just be removed as you set the behaviours directly but I can see how such methods could be useful when the classes become more complex

Fabulous work by the way this is helping me take my js learning to the next level thanks.

tcorral commented 13 years ago

Fixed. Thanks! ;)

2011/10/20 Gareth Elms < reply@reply.github.com>

A minor observation. In strategy\4\Duck.js. The setFlyBehavior() and set QuackBehavior() aren't called anywhere and also don't do what their names suggest. They can probably just be removed as you set the behaviours directly but I can see how such methods could be useful when the classes become more complex

Fabulous work by the way this is helping me take my js learning to the next level thanks.

Reply to this email directly or view it on GitHub: https://github.com/tcorral/Design-Patterns-in-Javascript/issues/4