Recently, I was discussing with another programmer the best way to refactor a huge(1000 lines) method full of \"if\" statements.
The code is written in Java, but I g
Can't tell if Chain of Responsibility is your answer, or even if GoF applies. Visitor might be the right thing. Not enough information to be certain.
It could be that your problem can be handled with good old-fashioned polymorphism. Or maybe a Map that used keys to pick out the appropriate handler object.
Keep 'do the simplest thing possible' in mind. Don't leap to the complex until you've proven to yourself that you need it.
I recently read about the Anti-IF campaign that promotes this idea. Sounds quite pertinent here.