DEV Community

Discussion on: Your most controversial opinion

Collapse
 
elmuerte profile image
Michiel Hendriks

So basically a chain-of-responsibility pattern. I can get behind that.

I think we can adapt Craig Zerouni's quote a bit to give us a nice rule:

If you have too many [special] cases, you're doing it wrong.

Collapse
 
cjbrooks12 profile image
Casey Brooks

Ah, I had no idea there was a name for this pattern, but that's exactly it! I see references to GoF everywhere, and I usually find I'm actually doing a bunch of these patterns myself already when I see it. Maybe I should actually read that book sometime...