Why would I ever use a Chain of Responsibility over a Decorator?

The fact that you can break the chain at any point differentiates the Chain of Responsibility pattern from the Decorator pattern. Decorators can be thought of as executing all at once without any interaction with the other decorators. Links in a chain can be thought of as executing one at a time, because they each … Read more

Avoiding instanceof in Java

You might be interested in this entry from Steve Yegge’s Amazon blog: “when polymorphism fails”. Essentially he’s addressing cases like this, when polymorphism causes more trouble than it solves. The issue is that to use polymorphism you have to make the logic of “handle” part of each ‘switching’ class – i.e. Integer etc. in this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)