Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: RFR: Inside-out classes - a Class::InsideOut primer

by xdg (Monsignor)
on Mar 16, 2007 at 15:02 UTC ( #605164=note: print w/ replies, xml ) Need Help??


in reply to Re^2: RFR: Inside-out classes - a Class::InsideOut primer
in thread RFR: Inside-out classes - a Class::InsideOut primer

Class::InsideOut does require the developer to consider whether one's attributes are public, private, or read-only

Well, perhaps it's clearer to say that Class::InsideOut emphasizes the decision through a choice of syntax.

Class::InsideOut tries to require as few things as possible:

  1. Objects: All new objects must be passed to (or created by) the register() function
  2. Properties: All data structures for object properties must be passed to the property() function.
  3. Direct Access: The key to directly access the property for an object in a property hash must be generated using refaddr() (from Scalar::Util) or the shorter alias id().

The public(), private() and readonly() functions just call property() with appropriate options.

I agree that showing it in practice rather than explaining all this is more appropriate for a primer

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


Comment on Re^3: RFR: Inside-out classes - a Class::InsideOut primer
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2014-09-22 19:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls