We want to use code contracts on our interfaces. We have a large interface hierarchy, leading to an awful lot of duplication in the contract classes.
We have an interface IX
which (through inheriting from other interfaces) has around 50 methods. There are several interfaces that derive from IX
. Interface IY
inherits from IX
, adding only a couple of methods. If I want to add a contract class for IY
, I need to reference all 50+ methods. Worse, if later on I decide to modify IX
, I have to change all the contract classes for all interfaces inheriting from IX
. This discourages developers from making changes.
Is there a way of avoiding this duplication?