Poker Hands – Refactoring into Chain of Responsibility

Poker Hands – Refactoring into Chain of Responsibility

Poker Hands are are put into sequential order and the player who holds the highest one wins. Let’s make fun of it then and perform some refactoring of code that identifies what poker figure given player holds. We will transform a set of nested if-else statements into a nice chain of responsibility classes (Straight Flush, Four of a Kind, Full House, ...) . This way the chain of classes put into sequential order will figure out the score given player holds. Proxy design patterns will come into the picture as well. All I can promise during this refactoring workshop is definitely no bluffing - just pure focus on code transformations. BTW : Did you know that real poker players are bluffing very rarely…? Prerequisite : become acquainted with poker rules if you haven’t played it so far, as business perspective and understanding existing code is the initial step for any refactoring. And don’t forget to install IntelliJ IDE - our master refactoring tool!Please download the following sources prior to attending the Master Class: https://github.com/wlodekkr/chain-of-responsibility