Re[2]: Prohibiting a Specific Attribute instance from being inherited!



Re[2]: Prohibiting a Specific Attribute instance from being inherited!

From: John Daniels <jd_at_syntropy.co.uk>
Date: Wed, 21 Jun 2006 08:37:35 +0100
Message-ID: <899889151.20060621083735@syntropy.co.uk>
Hi Muhammad,

> Is this the only solution to re-organise the hierarchy and how?

It might not be the only solution but it sounds like the correct one.

In general you should put a feature in a superclass only if you want
all subclasses to inherit it. If the superclass has many subclasses
but the feature is specific to only a few of them then you should
introduce a new class that holds this feature and put it between the
superclass and the subclasses that want the feature.

--John
Received on Wed 21 Jun 2006 - 08:38:31 BST