Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: May Thy Closures Be Blessed

by adrianh (Chancellor)
on Apr 26, 2004 at 17:08 UTC ( [id://348257]=note: print w/replies, xml ) Need Help??


in reply to Re: May Thy Closures Be Blessed
in thread May Thy Closures Be Blessed

Furthermore, Inside Out objects don't require their superclass, or subclasses, to cooperate.

They do need to co-operate over DESTROY.

Replies are listed 'Best First'.
Re: May Thy Closures Be Blessed
by Abigail-II (Bishop) on Apr 26, 2004 at 19:33 UTC
    They do need to co-operate over DESTROY.
    Yes, but not more than any other form of inheritance does. If you subclass a class, and define a DESTROY method in your subclass, without calling DESTROY in the superclass, things are likely to break. Your DESTROY method should always contain something like (for single inheritance):
    $self -> SUPER::DESTROY if $ISA [0] -> can ("DESTROY");
    regardless whether you use Inside-Out objects or not.

    Abigail

      Yes, but not more than any other form of inheritance does.

      Good point.

      I guess I just worry about DESTROY with inside-out objects more because having a correct DESTROY block suddenly becomes something you need for every class with its own state, rather than something you only need for rare classes that fiddle with external resources.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-11-10 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    chatterbot is...






    Results (37 votes). Check out past polls.