RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Dependency Inversion Principle

Comments

Simple & straightforward example. Nice. I may use it to explain the concept in the future.

I don’t think the criticism of the rspec book example is fair though: it’s a code example in a book designed to teach BDD, not patterns. Plus that specific example is so simplistic it doesn’t benefit from the change - especially since the abstraction has only one implemention. I would say your version of the rspec books code is over abstracted prematurely and makes the code worse.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in