Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Taming God Objects: easy, incremental and secure

Taming God Objects: easy, incremental and secure

Everyone has worked with an app with enormous classes, filled with mixed responsibilities. They're hard to understand, hard to change and hard to test.

In this presentation we're gonna learn a refactoring technique to start taming those little monsters.

Matheus Richard

January 27, 2021
Tweet

More Decks by Matheus Richard

Other Decks in Programming

Transcript






  1. View full-size slide

  2. God class
    You
    SRP

    View full-size slide

  3. WRITE
    Piece to
    extract
    READ
    WRITE

    View full-size slide

  4. READ
    User::Settings
    READ
    WRITE WRITE
    User::Settings

    View full-size slide

  5. READ READ
    WRITE WRITE
    settings
    User::Settings

    View full-size slide

  6. READ
    User::Settings
    READ
    WRITE WRITE
    settings
    WRITE
    User::Settings

    View full-size slide

  7. READ
    User::Settings
    READ
    WRITE WRITE
    settings
    WRITE
    user

    View full-size slide

  8. READ
    User::Settings
    WRITE WRITE
    settings
    WRITE
    READ
    user

    View full-size slide

  9. READ
    User::Settings
    WRITE
    settings
    WRITE
    READ
    user

    View full-size slide

  10. WRITE
    Piece to
    extract
    READ
    WRITE

    View full-size slide

  11. READ
    User::Settings
    READ
    WRITE WRITE
    User::Settings

    View full-size slide

  12. READ READ
    WRITE WRITE
    settings
    User::Settings

    View full-size slide

  13. READ
    User::Settings
    READ
    WRITE WRITE
    settings
    WRITE
    User::Settings

    View full-size slide

  14. READ
    User::Settings
    READ
    WRITE WRITE
    settings
    WRITE
    user

    View full-size slide

  15. READ
    User::Settings
    WRITE WRITE
    settings
    WRITE
    READ
    user

    View full-size slide

  16. READ
    User::Settings
    WRITE
    settings user

    WRITE
    READ

    View full-size slide





  17. View full-size slide


  18. ○ Refactoring (Book)

    ○ Get a Whiff of This (Talk at RailsConf 2016)

    ○ Strangler Fig Pattern

    View full-size slide