Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: perspective and object-disorientation

by Abigail-II (Bishop)
on Jan 18, 2003 at 00:30 UTC ( [id://227875]=note: print w/replies, xml ) Need Help??


in reply to Re: perspective and object-disorientation
in thread perspective and object-disorientation

Perl attempts to improve the performance of method invocations by caching the results of method lookups. These cached results become incorrect when @ISA is alterred

Oh, come on. Please get a newer version of Perl. I reported this bug in the beginning of 1997, and it was fixed shortly after. The Camel-II explicitely mentions that modifying @ISA clears the cache.

You're claiming that modifying @ISA is bad, because it changes the implementation of the class. But is that always bad? Installing a sub in an AUTOLOAD also changes the implementation of a class, and that's something done often.

I wouldn't recommend modifying @ISA, unless you're really sure what you are doing. But I also won't claim modifying @ISA should never been done.

Abigail

  • Comment on Re: perspective and object-disorientation

Replies are listed 'Best First'.
Re^2: perspective and object-disorientation
by adrianh (Chancellor) on Jan 18, 2003 at 00:35 UTC
    I wouldn't recommend modifying @ISA, unless you're really sure what you are doing. But I also won't claim modifying @ISA should never been done.

    See Test::Class & self-shunt pattern for one example where altering @ISA might be useful :-)

Re: Re: perspective and object-disorientation
by MarkM (Curate) on Jan 18, 2003 at 01:16 UTC

    Abigail: Come 'on' yourself. You must be having a crappy day to take only one thing out of my node and s$it on it. :-)

    I never claimed that modifying @ISA should never be done. Just, those who normally resort to modifying @ISA, are new to Perl, and don't really understand what they are doing.

    And even for people that do know what they are doing... it doesn't hurt to take a second look and consider whether there might not be an alternative that is more portable to other languages.

      If I wanted to write code that's more portable to other languages, OO would be one of the last things I'd consider using. Just one instance variable per object! I don't know any other language developer who considered doing that!

      Now, I wouldn't want to write code that's portable to other languages, but that's something else.

      Abigail

Log In?
Username:
Password:

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

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

    No recent polls found