Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: "Accessors (don't always) break encapsulation"

by Ovid (Cardinal)
on Jul 19, 2005 at 17:51 UTC ( [id://476200]=note: print w/replies, xml ) Need Help??


in reply to Re^2: "Accessors (don't always) break encapsulation"
in thread "Accessors break encapsulation"?

Actually, I wasn't referring to those modules at all. Ignoring potential issue with premature optimization -- issues that I feel are more significant in Perl as it's rather slow and we don't have lazy evaluation -- if a logging module is there to allow the user to log stuff, then of course we need to figure out whether or not it's appropriate to call the method. In the example I used, it was a hypothetical example regarding something the programmer shouldn't have to worry about. In your example, you present an external API that the programmer should decide whether or not to call because that's the entire rationale behind the module.

Sorry if I wasn't clear.

Cheers,
Ovid

New address of my CGI Course.

  • Comment on Re^3: "Accessors (don't always) break encapsulation"

Replies are listed 'Best First'.
Re^4: "Accessors (don't always) break encapsulation"
by diotalevi (Canon) on Jul 21, 2005 at 17:20 UTC

    We sure do have lazy evaluation!

    $obj->log_error( promise { Dumper($some_very_large_structure) } ); package Promises; use overload( '""' => sub { $_[0]->() } ); sub promise (&) { return bless $_[0], __PACKAGE__ }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-23 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found