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

Re: Autoload versus auto-generating accessors

by VinsWorldcom (Prior)
on Feb 11, 2016 at 16:28 UTC ( [id://1154982]=note: print w/replies, xml ) Need Help??


in reply to Autoload versus auto-generating accessors

I barely tread water at this point as it hits the limits of my understanding of the object oriented model, but I'll offer this:

  • When I subclass a module, add some capability but then want all the parent's accessors available, I use AUTOLOAD. See Net::Telnet::Cisco source for an example - note it's not my module, but I've used that example in some of my stuff.

  • When I create my own stuff and the object has a ton of stuff that all needs accessors and they all are pretty much the same save for the key/value pair, I create them programmaticly. See Cisco::SNMP source for example, specifically the _mk_accessors_*() subs and how they're called from the sub modules (Cisco::SNMP::*)

  • Comment on Re: Autoload versus auto-generating accessors

Replies are listed 'Best First'.
Re^2: Autoload versus auto-generating accessors
by goldenblue (Acolyte) on Feb 16, 2016 at 15:35 UTC

    In what case don't you get the parent's accessors, anyway? Isnt that what subclassing is all about? What am I misunderstanding?


    --

Log In?
Username:
Password:

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

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

    No recent polls found