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

Plain, Old, But Mighty: Leveraging POROs in Gre...

Plain, Old, But Mighty: Leveraging POROs in Greenfield and Legacy Code

Applications exist in changing ecosystems, but over time, they can become less responsive. Controllers actions slowly grow in responsibilities. Models designed for one requirement, no longer fit the bill, and require multi-step deploy processes to change.

The plain old Ruby object, the mighty PORO, provides flexibility in both new domain and legacy code.

Pair with me on how! We'll explore how we can leverage POROs in our application through some real world examples. We'll use objects as a facade for domain logic in development, and refactor objects out of legacy code to increase readability, ease of testing, and flexibility. You'll leave this session with some strategies to better leverage Ruby objects in your own application.

Avatar for hello_sweta

hello_sweta

May 16, 2024

Other Decks in Programming

Transcript

  1. @SwetaSanghavi A seam is a place where you can alter

    behavior in your program without editing in that place 2 Working Effectively with Legacy Code - Michael Feathers 🌱
  2. @SwetaSanghavi Thinking of the new object is harder than writing

    the code 3 All the Little Things - Sandi Metz 2 🌱
  3. @SwetaSanghavi • Code that the original developer no longer maintains,

    whether from another developer or team • Code that is no longer engineered but continually patched • Untested Code The Engineer's Complete Guide to Legacy Code 3 🧶
  4. CREDITS • Books ◦ Working Effectively with Legacy Code -

    Michael Feathers • Talks ◦ All the Little Things - Sandi Metz ◦ Refactoring from Good to Great - Ben Orenstein • Presentation Template ◦ SlidesMania • Images ◦ FullofCharm Maine Coons ◦ La Guarimba Film Festival ◦ Saeedabusinn on Pinterest ◦ Conceptual Understanding of Ruby Classes and Objects for Beginners
  5. CREDITS • Talk Feedback ◦ Dawn Richardson ◦ Aji Slater

    ◦ Nicolas Collins ◦ Gautam Sanghavi ◦ Daksha Sanghavi
  6. CREDITS • Talk Feedback ◦ Dawn Richardson ◦ Aji Slater

    ◦ Nicolas Collins ◦ Gautam Sanghavi ◦ Daksha Sanghavi Dad!