Ebay legacy-code-retreat

3,803 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,803
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
6
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Ebay legacy-code-retreat

  1. 1. Refactoring by example Konrad Malawski kmalawski@ebay.com @ the sprinters
  2. 2. Refactoring to Patterns • Internally available for free on safari: 
 http://techbus.safaribooksonline.com/book/ software-engineering-and-development/refactoring/ 0321213351/advance-praise-for-refactoring-topatterns/i?query=((Refactoring+to +Patterns))#snippet
  3. 3. Legacy Code Retreat • We’ll use an existing codebase • Try to understand it • Apply automatic refactorings • Test it
  4. 4. Legacy Code Retreat • github / kmalawski / legacy-code-retreat-java • git clone git@github.scm.corp.ebay.com:kmalawski/legacycode-retreat-java.git
  5. 5. Popular refactorings • Extract Method • Introduce Variable / Field / Constant / Parameter • iNline • Pull Up / Push Down • Introduce Interface • Move Class / Move Instance Method (F6)
  6. 6. Popular refactorings • Rename (Shift F6) • Extract Interface / Class • Introduce Parameter Object • Introduce delegate • Introduce “null object” / Optional / Option
  7. 7. Popular refactorings • Dependency Injection (NOT THE FRAMEWORK ”X”) • Introduce Adapter • Replace Conditionals with Strategy • Remove “Primitive Obsession” • Generify
  8. 8. 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”
  9. 9. Legacy Code Retreat • 10: 25 min coding • 20: 5 min retro • 30: goto 10

×