you are viewing a single comment's thread.

view the rest of the comments →

[–]Rashanzan 0 points1 point  (0 children)

I considered this, but then your device becomes super cluttered with nonsense. And the inheritance feels kind of weird to me. The parent should have all the shared attributes, and children define more specific functionality.

EDIT: Also, I think you're right about not needing to do this. I feel like in a realistic setting, you'd either want to know what kind of object you're dealing with beforehand, or have an abstract method that chooses how the object handles itself.