Sunday, June 24, 2007

make sure public inheritance models is a relationship

a derived class is a specialized version of base class so it should follow all constraints and provide all functionalities of the base class.

so pre conditions of dervied shud be subset of pre conditions of base
post conditions shud be superset of post conditions

differentiate between penguins cant fly and penguins can fly, but it is actually an error to make them fly.

things to remember:
public inheritance means is a . everything that applies to base classes must also apply to derived classes, because every derived class object is a base class objects

No comments: