Tag Archives: command pattern

Code Refactoring 13

Replace Conditional with CommandIn this part of my code refactoring tutorial, I’ll show you how to replace conditionals with the command pattern. I’m also going to do more though.

I’ll also review what the command pattern is. I’ll give an example of when you should use it. We’ll look at how to add flexibility with it. I’ll answer your questions based on the refactoring to patterns book. And, we’ll look at how to store commands in an ArrayList. If you need more look at my Command Design Pattern Tutorial and the code below. Continue reading Code Refactoring 13