Poker Hands - Refactoring into Chain of Responsibility

Wlodek Krakowski

Short workshop - in English

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 refactorings 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.

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. 

Don’t forget to install IntelliJ IDE - our master refactoring tool! (Community Edition is enough) and install the sources for the workshop before attending it. https://github.com/wlodekkr/chain-of-responsibility">https://github.com/wlodekkr/chain-of-responsibility

Primarily for:

Participant requirements: Personal laptops with - Java 1.8+ - IntelliJ Community Edition - installed sources