Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Re: Re: Short Refactoring Tip: let the object do it for you

by mvc (Scribe)
on May 22, 2003 at 19:58 UTC ( #260198=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Short Refactoring Tip: let the object do it for you
in thread Short Refactoring Tip: let the object do it for you

  1. You are correct that reducing the need for "can you do this? yes? then do it" was what I was trying to say. This was the problem with the original solution.
  2. When I think about it (why always AFTER I post?!) you are correct in saying that I am misrepresenting encapsulation. Query methods are a tool to defend encapsulation. Getters break encapsulation. Query methods (any methods actually) increase coupling- of course the ultimately independent object has no methods, and is ultimately useless. What I was trying to say was that in our example (although it is sketchy) we can decrease coupling by dispensing with the query methods.

So a predicate function is a boolean query method.


Comment on Re: Re: Re: Re: Re: Short Refactoring Tip: let the object do it for you

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://260198]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2015-07-31 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls