in reply to Re: Short Refactoring Tip: let the object do it for you
in thread Short Refactoring Tip: let the object do it for you
How, pray tell, does a predicate function "break encapsulation"? can_send is not a getter; it reveals nothing about how the purchase order answers the question. Encapsulation is quite safely preserved.You are breaking encapsulation in all but the last case.BAD: if ($po->status->name eq 'Sent') ... ALMOST AS BAD: if ($po->can_send) ... GOOD: $po->send
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Short Refactoring Tip: let the object do it for you
by mvc (Scribe) on May 22, 2003 at 11:08 UTC | |
by dws (Chancellor) on May 22, 2003 at 18:46 UTC | |
by mvc (Scribe) on May 22, 2003 at 19:58 UTC | |
by Anonymous Monk on May 22, 2003 at 16:58 UTC |
In Section
Meditations