vendredi 4 avril 2014

Interface inheritance - Issue with double inheritance


Vote count:

0




I need to define 4 interfaces with names and methods as given in the first picture. Pic 1


But, I need to maintain the following relationship:



  • LivingBeingMutable "is a" LivingBeingConst

  • AnimalConst "is a" LivingBeingConst

  • AnimalMutable "is a" LivingBeingConst

  • AnimalMutable "is a" LivingBeingMutable

  • AnimalMutable "is a" AnimalConst


So, I modified the interfaces with inheritance as shown below: Pic2


But the problem is, AnimalMutable is getting two instances of "GetLifeSpan()" methods (one from AnimalConst and another from LivingBeingMutable). Could anyone let me know what is the correct way to design it?



asked 19 secs ago






Aucun commentaire:

Enregistrer un commentaire