ebay legacy-code-retreat

Post on 15-Jan-2015

3.156 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Refactoringby example

Konrad Malawski kmalawski@ebay.com @ the sprinters

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 git@github.scm.corp.ebay.com: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

top related