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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |