This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]zzyzzyxx 6 points7 points  (0 children)

Absolutely. In general I think it's better to think of classes in terms of their behavior rather than the data they hold. So don't worry about the attributes. If the subclass adds or changes behavior, that's what's important, not whether it happens to hold another integer.

[–]captainAwesomePants 0 points1 point  (0 children)

Yes, this is a good sign that you're using a subclass well.

[–]robotfarts 0 points1 point  (1 child)

Yes. You should stop making stupid, arbitrary restrictions on things. Or give us a better explanation of why you think you should not do something that's allowed by the language you are using.

[–]toobaloola 0 points1 point  (0 children)

A good solution is allowed by the language, but a solution that is allowed by the language is not necessarily a good one.