M I k a d
- Using Japanese to save your
M K Using Japanese to save your I a Legacy S/W k n + a b d - - PowerPoint PPT Presentation
M K Using Japanese to save your I a Legacy S/W k n + a b d a o n Mikado Method Mikado Game Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in the pile. Removing one impacts the
Making a change to your legacy code is not unlike picking out the Mikado from the other sticks in the pile. Removing one impacts the others.
And not in a good way…
What is the biggest difference?
next set of changes to make before doing this
Repeat until no breakages occur.
Decouple Content Edit & Publishing Servers
Create Standalone Publish Server Reimplement DB Interface Remove Methods from Edit Server Code Separate Storage Interface
D i s c o v e r y R e f a c t o r
Move Check User Permissions Separate Approval Logic Move Publish-Reject Code Change Deployment Properties
to ID the next items to be graphed
you are touching
mimics as close to production as possible
acceptance tests
showing failures that the change creates
consumers it serves)
Libraries Let’s look at the first one…
. . . public static final int FIVE_CARD_POKER = 0; public static final int INDIAN_POKER = 1; . . . Public class CardGameEngine { . . . public void deal (Game game, User user, Dealer dealer) { if (game.getType() == FIVE_CARD_POKER { user.setCards(dealer.deal(5)); } else if (game.getType() == INDIAN_POKER { user.setCards(dealer.deal(1)); } else { // else what? } }
messy, especially if I wanted to add more…
Add War card game
Refactor If statements to extract game-specific logic Move 5 Card Poker Logic to FiveCardPoker class Move Indian Poker Logic to IndianPoker class Implement War Logic to War class
Triage Ready Intake Update Tests FIX Re-Test Deploy DONE Done Done Done
あ り が と う ご ざ い ま し た