Skip to main content

Subscribe to GoRails to get access to this episode and all other pro episodes, and new awesome content every month.

Subscribe Now
Only $19/month

Unlimited access. Cancel anytime.

21 Open Closed Principle

Episode 240 · April 17, 2018

Software entities should be open for extension but closed for modification

Design Patterns


Transcripts

Subscribe or login to view the transcript for this episode.

Discussion


Gravatar
Gerardo Raiden (330 XP) on
Loved the bla bla bla on minute 8ish :)
Great video! Thanks

Gravatar
eminkel (2,500 XP) on
What would a folder structure for this system design in a Rails app look like?

Gravatar
William Kennedy (3,630 XP) on
Quick question Chris, when you were building out functionality like this for Hatch, how much of this structure do you plan versus how much did you arrive at through refactoring and iteration? 
Gravatar
Chris Oliver (169,620 XP) on
For most of this, I knew there was going to be a lot of code so I'd start doing the single responsibility work separation of this code into its own files and folders first. I didn't build this multi-provider thing out until I supported more than just DigitalOcean. 

It's really easy to refactor your code into this, so it's not something you need to start with ahead of time. In fact, trying to follow design patterns too early is often one of the easiest ways to end up with confusing code. Refactoring to apply patterns later on is usually the best approach.

Gravatar
stefan (10 XP) on
this is fantastic, more like this please

Login or create an account to join the conversation.