in reply to Re^4: Help understanding object constructors (by Perl Best Practices book)
in thread Help understanding object constructors
Class::Std is, first off, not thread-safe.And I was thinking you were objecting against inside-out objects. Class::Std is one way of doing it - and IMO, not the best way.
Second, if I inherit from Class::Std to create my own OO model based on it and I don't call SUPER in the DESTROY, there's a memory leak.Sure, but that's not a Class::Std quirck. If you subclass any class that has a DESTROY function, and you create your own DESTROY function without calling SUPER, you will have a problem. Be it a memory leak or something else. It's an artifact of the way Perls objects are designed (no auto cascading of either DESTROY or AUTOLOAD) - not something unique to inside-out objects, or Class::Std.
My benchmark numbers are simple ones from playing with it and what I've seen reported.Feel free to post your benchmarks.
As for subclassing, Damian has tried to work around the problems when two attributes are declared with the same name in the same hierarchy. But, that's still a problem. While you and I both know that it's a problem inherent to inheritance and composition in general, people cite inside-out objects as a way of avoiding hashkey clashes (which it is), then conclude that it's a way of avoiding attribute clashes (which it isn't).I've no idea what you mean by this. Could you give an example?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Help understanding object constructors (by Perl Best Practices book)
by dragonchild (Archbishop) on Nov 08, 2005 at 13:18 UTC |