All threads / Dependency Inversion Principle Discussion

Ask A Question

Notifications

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.
Reply
I want to see more of this kind of stuff. I've now let you know in the comments below the video. :-)
Reply
This is a great episode.  Everyone should learn SOLID
Reply

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

Reply

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.

Reply
Join the discussion

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

Join 37,106+ 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.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.