Inheritance policy when designing the base class
Posted
by
Xaqron
on Stack Overflow
See other posts from Stack Overflow
or by Xaqron
Published on 2011-01-06T03:28:34Z
Indexed on
2011/01/06
3:53 UTC
Read the original article
Hit count: 187
I have a base class and a derived class both in design phase. The base class will remain one but many derived class will inherit from it. So it's very costly to make change to derived classes in the future and I'm looking for the best design to prevent this.
In fact derived class only needs a few methods to override (if needed) but it's tempting to reveal more details to it.
My question is about the policy which is extensible in future.
Can I minimize the inherited methods/properties to derived class and reveal more in the next versions if needed without any change to derived classes ?
Or I should reveal anything that maybe used by derived classes in the future and let them to choose if they need them or not ?
Thanks
© Stack Overflow or respective owner