Discover this podcast and so much more

Podcasts are free to enjoy without a subscription. We also offer ebooks, audiobooks, and so much more for just $11.99/month.

RR 409: Turning Fat Models Into Skinny POROs with Jason Swett

RR 409: Turning Fat Models Into Skinny POROs with Jason Swett

FromRuby Rogues


RR 409: Turning Fat Models Into Skinny POROs with Jason Swett

FromRuby Rogues

ratings:
Length:
50 minutes
Released:
Apr 16, 2019
Format:
Podcast episode

Description

Sponsors


Sentry use code “devchat” for 2 months free
Triplebyte $1000 signing bonus
Redisgreen


Panel


Charles Max Wood
Dave Kimura


Special Guest: Jason Swett

Episode Summary

Jason Swett is a former host on Ruby Rogues. Now he has his own show, Ruby Testing Podcast and runs the site codewithjason.com where he teaches Rails testing. Today, Jason discusses turning fat models into skinny POROs (Plain Old Ruby Objects). He once read an article that said you don’t have to put all your code into active record models, that you can create plain ruby objects. These can go into active models if you want, but you’re not limited to active record models, you can make your own classes. This realazition greatly impacted the way he structures his code.

The panelists talk about the individual ways the structure their code. Jason discusses other structuring methods he has tried and gives some examples of using skinny POROs in the apps he works on. They discuss the pros and cons of using skinny POROs instead of active models, pros being it cleans up the model and makes testing easier, and the cons being it adds to a bit of overhead to the application, as somebody unfamiliar with the application might recreate parts if you don’t have an index.

The panel discusses how to decide when you want to create a new PORO. They talk about each of their methods and discuss the the usefulness of token generators. They conclude that in order for skinny POROs to be effective in code, they must be well factored and organized, and that unfortunately some complexity in code is unavoidable.

Links


POROs- Plain Old Ruby Objects
Model
Active record models
Namespace
Service objects
Value objects
CSS
Form object
Tokens
Initializer
Singleton object


Picks

Dave Kimura:


Reek
Kubernetes


Charles Max Wood:


Cloud66
Podwrench
Podcasting booth
New podcasts coming to DevChat-- if you want to revive a podcast that has stopped airing, contact Charles Max Wood
Programming Podcasters Slack chat


Jason Swett:


Practical Object Oriented Design in Ruby
Ruby Testing Podcast
Codewithjason.com

Special Guest: Jason Swett.
Released:
Apr 16, 2019
Format:
Podcast episode

Titles in the series (100)

All ruby related podcasts from Devchat.tv, including: - Ruby Rogues - My Ruby Story - Ruby Rants