Optional Multiple-Inheritance .NET

DVD_GR

New Member
I am building a relatively simple app and a little bit confused on a better practice of design.I have a main class MClass. Classes Child1 and Chil2 both inherit from MClass. Now, there is another class AClass, which can inherit from either Child1 or Child2, but not both at the same time (which is only possible through, I believe, interface).How do I go about having this optional inheritance from one or the other class?There are also classes AChild1 and AChild2, which both inherit from AClass. The end result would be as follows:MClass:Child1:AClass:AChild1MClass:Child2:AClass:AChild2These are the only two options possible. Is it better to simply combine AClass with its children having MClass:Child1:AClass1MClass:Child2:AClass2I could do this but AClass1 and AClass2 would have a lot of redundant fields... Any reccomendations?Thank you!
 
Back
Top