Ebay legacy-code-retreat
-
Upload
konrad-malawski -
Category
Technology
-
view
3.155 -
download
1
description
Transcript of Ebay legacy-code-retreat
Refactoring to Patterns
• Internally available for free on safari: http://techbus.safaribooksonline.com/book/software-engineering-and-development/refactoring/0321213351/advance-praise-for-refactoring-to-patterns/i?query=((Refactoring+to+Patterns))#snippet
Legacy Code Retreat
• We’ll use an existing codebase
• Try to understand it
• Apply automatic refactorings
• Test it
Legacy Code Retreat
• github / kmalawski / legacy-code-retreat-java
• git clone [email protected]:kmalawski/legacy-code-retreat-java.git
Popular refactorings• Extract Method
• Introduce Variable / Field / Constant / Parameter
• iNline
• Pull Up / Push Down
• Introduce Interface
• Move Class / Move Instance Method (F6)
Popular refactorings• Rename (Shift F6)
• Extract Interface / Class
• Introduce Parameter Object
• Introduce delegate
• Introduce “null object” / Optional / Option
Popular refactorings• Dependency Injection (NOT THE FRAMEWORK ”X”)
• Introduce Adapter
• Replace Conditionals with Strategy
• Remove “Primitive Obsession”
• Generify
When you’re not sure
• F2 - go to next error / warning
• Meta Shift A - grep all commands
• Alt Enter - act on hints
• Ctrl T - “refactor this”
Legacy Code Retreat
• 10: 25 min coding
• 20: 5 min retro
• 30: goto 10