2. WHAT IS REFACTORING
Refactoring is a
disciplined technique
for restructuring an
existing body of code,
altering its internal
structure without
changing its external
behavior
3. REFACTORING CATALOG
• ▶Add Parameter
• ▶Change Bidirectional
Association to Unidirectional
• ▶Change Reference to Value
• ▶Change Unidirectional
Association to Bidirectional
• ▶Change Value to Reference
• ▶Collapse Hierarchy
Expression
• ▶Consolidate Duplicate
Conditional Fragments
• ▶Decompose Conditional
• ▶Duplicate Observed Data
• ▶Dynamic Method Definition
• ▶Eagerly Initialized Attribute
4. THE GOALS
• Make code more readable and comprehensible
• Eliminate duplication
5. WHY?
• Lots of time is spent reading code
• Bugs hide in obscure code
• Duplication makes code rot
• LEARNING!
16. CURRENT STATUS
• Mostly safe with “normal”
code.
• No fancy installation
available
• Use the README at
https://github.com/dagfin
nr/perl-extract-method