Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^7: Object Constructors - Advice of experienced OO Perl Monks

by Perl Mouse (Chaplain)
on Oct 06, 2005 at 16:46 UTC ( [id://497992]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Object Constructors - Advice of experienced OO Perl Monks
in thread Object Constructors - Advice of experienced OO Perl Monks

The fact that MI is quite hard to do in Perl, and considering that most authors make it even harder might also be an not insignificant reason why you don't see many modules making use of MI.

But I'm not saying you should use MI. I'm just saying it's impolite to make it harder for others to use MI. The harder you make it for others to do things (for instance, setting magical variables without using local, not using name spaces, writing code that isn't cross-platform), the less useful your code is.

Let's not forget the question of the OP: Are there any limits on what you can/can't or should/shouldn't put into a constructor?. An answer to that question is don't put initialization of your object in the constructor, because it makes it harder to do MI.

Perl --((8:>*
  • Comment on Re^7: Object Constructors - Advice of experienced OO Perl Monks

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-25 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found