Ruby on Rails Wednesday, March 26, 2014

On Wed, Mar 26, 2014 at 10:32 AM, masta Blasta <lists@ruby-forum.com> wrote:

> If only the engine class has a method
> called 'start' then Car is effectively coupled to Engine.

Since one could theoretically create another class that supports
#start (and your later examples of #gear_up and #stop, probably
delegating #gear_up to a Transmission-like class), I think it's still
effectively decoupled. In particular, when *testing* the Car, one
could create it with a MockEngine that's only used in the tests.

--
Dave Aronson, freelance software developer (details @ www.Codosaur.us);
see also www.PullRequestRoulette.com, Blog.Codosaur.us, www.Dare2XL.com

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQijfXKQ41FAwxjhij7_KZog%2Bp6yfBC-Stsi27od-otgxqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment