mehlah/refactoring-example — pull request #6 by mehlah (2012-12-28 20:14:37+00:00)
Title: Replace switch with polymorphism

Since we can't simply replace the switch statement by using 3 movies subclasses (because a movie can change its classification during its lifetime), we use the State Pattern and introduce a Price Class

First we move the type code behavior into the state pattern with **Replace Type Code with State/Strategy**. Then I can use **Move Method** to move the switch statement into the price class. Finally we use **Replace Conditional with Polymorphism** to eliminate the switch statement.

Done both for `getCharge` and `getFrequentRenterPoints` methods