go ahead... be a heretic | |
PerlMonks |
Re^3: Perl OOPby tobyink (Canon) |
on Jul 05, 2017 at 09:16 UTC ( [id://1194212]=note: print w/replies, xml ) | Need Help?? |
I don't see why that would be good practice. Let's create a telephone class:
Now let's use it:
The object is immutable, in that once it's been instantiated, you can't use its public API to alter the number string. But that shouldn't stop us from subclassing it:
It doesn't in any way compromise the immutability of the parent class.
In Section
Seekers of Perl Wisdom
|
|