NICOLÁS BOTTARINI
Volver a la ruta

El recorrido

Refactoring

479 páginas de lectura

Refactorizar es mejorar el diseño sin cambiar el comportamiento, de a pasos chicos y con los tests en verde todo el tiempo. Es lo que hace posible el diseño evolutivo: no hace falta acertar el diseño de entrada si lo podés mejorar de forma segura todos los días.

Temas

Etapa 1 · TDD y objetos
  • Fundamentos de refactoring

    Proceso, Baby steps

  • Code Smells

    Mysterious Name, Duplicated Code, Long Function, Long Parameter List, Global Data, Mutable Data, Divergent Change, Shotgun Surgery, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Loops, Lazy Element, Speculative Generality, Temporary Field, Message Chains, Middle Man, Insider Trading, Large Class, Data Class, Refused Bequest, Comments

  • Refactorings básicos

    Extract Function/Method, Inline Function/Method, Extract Variable, Inline Variable, Change Function Declaration, Encapsulate Variable, Rename Variable, Introduce Parameter Object, Combine Functions into Class, Combine Functions into Transform, Split Phase

Etapa 2 · Principios de diseño
  • Refactorings de encapsulamiento

    Encapsulate Record, Encapsulate Collection, Replace Primitive with Object, Replace Temp with Query, Extract Class, Inline Class, Hide Delegate, Remove Middle Man, Substitute Algorithm

  • Refactorings para mover funcionalidad

    Move Function, Move Field, Move Statements into Function, Move Statements to Callers, Replace Inline Code with Function Call, Slide Statements, Split Loop, Replace Loop with Pipeline, Remove Dead Code

  • Refactorings para organizar datos

    Split Variable, Rename Field, Replace Derived Variable with Query, Change Reference to Value, Change Value to Reference

  • Refactorings de lógica condicional

    Decompose Conditional, Consolidate Conditional Expression, Replace Nested Conditional with Guard Clauses, Replace Conditional with Polymorphism, Introduce Special Case, Introduce Null Object, Introduce Assertion

  • Refactorings de API

    Separate Query from Modifier, Parameterize Function, Remove Flag Argument, Preserve Whole Object, Replace Parameter with Query, Replace Query with Parameter, Remove Setting Method, Replace Constructor with Factory Function, Replace Function with Command, Replace Command with Function

  • Refactorings de herencia

    Pull Up Method, Pull Up Field, Pull Up Constructor Body, Push Down Method, Push Down Field, Replace Type Code with Subclasses, Remove Subclass, Extract Superclass, Collapse Hierarchy, Replace Subclass with Delegate, Replace Superclass with Delegate

Recursos

Katas para practicar

Gilded Rose

Gilded Rose

Una kata famosa para arrancar tu camino en refactoring

BásicoMedia
Ver kata
Ugly Trivia

Ugly Trivia

Un juego de trivia con código feo listo para refactorizar

AvanzadoMedia
Ver kata