Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How do I report an error back to the user of my object?

by sundialsvc4 (Abbot)
on Jun 05, 2012 at 12:30 UTC ( [id://974442]=note: print w/replies, xml ) Need Help??


in reply to How do I report an error back to the user of my object?

My personal preference in such matters is that “instantiating an object” is one thing, and “loading it with data” is another thing entirely.   Therefore, I will define the constructor to initialize the object and to set a loaded property to False.   Then, I will define a separate load() method.   I will also define a must_be_loaded() method that returns “self” if the object is loaded (as expected), or will die if it is not.   This “pass-thru method” is used in every getter-method that retrieves data from the object.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-23 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found