Afficher un message
Vieux 03/04/2008, 00h28   #5
Trans
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.

  Réponse avec citation
 
Page generated in 0,06229 seconds with 9 queries