Re: A Question Of Coupling
On Apr 2, 3:17 pm, "Jason Roelofs" <jameskil...@gmail.com> wrote:
> My issue with #2 is that the return value of bar.okay? might change,
> but with this implementation Foo#okay? won't ever change.
That's a good point. I guess that crystalizes the coupling.
Coupled:
class Foo
def initialize(bar)
@bar = bar
end
Decoupled:
class Foo
def initialize(bar)
@bar = bar.dup
end
T.
|