Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Safely altering the behaviour of heavily used modules

by hv (Parson)
on Mar 09, 2005 at 13:12 UTC ( #437887=note: print w/ replies, xml ) Need Help??


in reply to Safely altering the behaviour of heavily used modules

I think you're going about this the wrong way: this is not a backwards-compatible change, and since Storable is a very heavily used module there are bound to be many STORABLE_thaw methods out there that are not on CPAN, and that will be broken by this change.

The only way you could make a backward compatible change to the way STORABLE_thaw is called would be to change something that would otherwise be guaranteed to be an error, and I think that is likely to be difficult to arrange.

Alternative approaches: add a new method that Storable could look for as well as/in preference to STORABLE_thaw; add a completely new interface to Storable; or subclass Storable.

Hugo


Comment on Re: Safely altering the behaviour of heavily used modules
Select or Download Code
Re^2: Safely altering the behaviour of heavily used modules
by adamk (Chaplain) on Mar 10, 2005 at 01:47 UTC
    Hmm... well perhaps I should have said it is "intended" to be backwards-compatible. And in the strictest sense, if every use of STORABLE_thaw did a "return;" to return nothing it would be.

    That said, you are right on the possible ways of doing it provably safely.

    But things get ugly quickly... STORABLE_thaw2? STORABLE_freezify/thawify? Storable::SaneThawing?

    None of these are particularly elegant, and you could argue that many just make the problem of bad interfaces worse.

    Unless of course, we moved to Storable2 and redesigned the API. Although Storable works well enough, I must say I do find the plethora of similar-but-different functions somewhat PHP'esk.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-12-22 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (112 votes), past polls