All threads / Dependency Inversion Principle Discussion
Ask A Question


You’re not receiving notifications from this thread.

Dependency Inversion Principle Discussion

Thank you for these quality episodes. We definitely want to see more episodes like this. It would be nice to see them how they are applied to real-world projects. How to create the folder structure and apply all these principles there.
I want to see more of this kind of stuff. I've now let you know in the comments below the video. :-)
This is a great episode.  Everyone should learn SOLID

Thanks for the eposide.
I don't understand why there is a need to say :digitalocean) (last line in code)
Shouldn't the provider be encoded only by the object passed to the perform method ?

So in here I see you're passing the Server::Create object an argument with the provider, which is something it already has (since it's in the server, and the Server::Create object knows the server).

This creates the possibility that someone might eventually try to call #perform(:linode) on an instance that has a :digital_ocean as the server.

Do you think we should depend on documentation and testing in these cases?
If I have a passing test verifying this case is correctly handled, I think it'd be OK.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 68,326+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.