In this last step, we finally get rid of the switch-statement that’s been bothering me since the start. Using the State Pattern (Gang of Four) we achieve an extensible and more comprehensible implementation. Unfortunately, there’s not too much too support for this kind of task, so we finally have to get our hands dirty.
► All Refactoring Episodes: http://goo.gl/f7Yf21
► Let’s Develop! http://letsdeveloper.com
► Don’t Miss an Episode: http://goo.gl/whzDi1
► Check out the Code: https://github.com/letsdeveloper/Lets-Refactor-MovieRental
«Refactoring»
“A change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior”, http://martinfowler.com/books/refactoring.html
«Other Series»
► Let’s Develop Conway’s Game of Life: http://goo.gl/xc59GX
► Let’s Develop With Git in Eclipse: http://goo.gl/phqnDe
► Let’s Develop With Maven in Eclipse: http://goo.gl/3KK2gb
Share this: | Follow me: