Thanks for the word of caution NetWallah and stevieb. Stability is in the *$^&£@&* of the beholder, I say, though it sounds cockier than it is.
As a side remark, personally I would never publish anything which can not be expanded or inherited by 3rd party. If I can't do it, even if it is "lightning fast" I would consign it to the catacombs. But everyone is different and everyone has their reasons and not everyone can write "lightning fast" browsers.
For the record, Furl does not offer adding callbacks (LWP::UserAgent's add_handler()) to be called at the various phases of the transaction, so it does not serve my purpose. I ended using LWP::Protocol::Net::Curl which, so far, keeps its word as "drop-in curl replacement for LWP::UserAgent", including callbacks and some speed improvement by mere use LWP::Protocol::Net::Curl; uuse parent 'LWP::UserAgent';
bw, bliako
| [reply] [d/l] [select] |
Breaks encapsulation
I have been regurgitating this for awhile and I wonder if it isn't too extreme. In the sense of "since when inheritance breaks encapsulation?" | [reply] |
Child classes shouldn't rely on private implementation details of their superclass.
Some OO languages have the concept of "protected" parts of their API somewhere between public and private — methods/attributes which subclasses may use, but are otherwise not part of the public API. In Perl, this can only really be accomplished by convention.
http://blogs.perl.org/users/toby_inkster/2014/07/method-privacy-in-perl.html
| [reply] |
Child classes shouldn't rely on private implementation details of their superclass.
Fine tobyink, clear and acceptable. Albeit (I am talking in general and not for some module mentioned here), a hint in the pod a la "do not subclass me, I don't like to play ball this way" would have gone further than trying to obscure. My opinion, for what is worth, is that if you write OOP then play OOP. Exhibhit your private parts but with ample of warnings not to be touched and allow for some kind of subclassing for some of your public functioning so as to move the state-of-the-art a click forward.
bw, bliako | [reply] |
Understand clearly that NetWallah is suggesting something that can break things very easily and subtly.
Please review that post, where it was said "not a good idea".
Do not break things like this. Do not work this way. It was a concept piece of code that shows 'how' you could do something, not how you *should* do something.
If you continue on this path now, you'll do so going forward. Don't.
Proof of Concept chunks of code are just that... tests.
| [reply] |