I like your LandRover analogy. In that system, my interpretation of the spirit of tobyink's analogy becomes: I buy a LandRover, and want to create a LandRover::PryrtMod, wherein I plug in an OBDII unit into the standard OBDII slot of my LandRover, so that I can look at some of the sensor data that they don't provide using my smartphone app. Or similarly, years ago, I bought a Mazda::RX8 v2005; in the intervening time, backup cameras became the norm on newer cars, so I bought an aftermarket backup camera, and created the Mazda::RX8::PryrtBackupMod which inherited the full Mazda::RX8 object, but just added the callback Mazda::RX8::PryrtBackupMod::enableBackupCam(), and I registered that callback for use inside Mazda::RX8::changeGear(). I understood when I made Mazda::RX8::PryrtBackupMod that it could possibly void any warranty, but I was able to weigh the risks vs. benefits and make an informed engineering decision. Mazda, as the manufacturer, can discourage people from trying to subclass their vehicles, and can void warranties if their product is inappropriately modified; but at some point, car hackers will find a way to subclass a vehicle with aftermarket modifications. Similarly, a Perl hacker will often be able to figure out how to subclass and add functionality to your "immutable object" class.


In reply to Re^5: Perl OOP by pryrt
in thread Perl OOP by QueenSvetlana

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.