This question is specific to C# not providing multiple inheritance unlike C++ and the need to go about using interfaces to implement multiple inheritance.

Itís about Multiple Inheritance and how to solve diamond Inheritance problem.

To begin with this is what my class design looks like, on a very high level.

struct DOB{
int dd,mm,yy;
}

class Player{
string firstName,lastName;
DOB dob;
string debutPlace, homeTown;
//a few methods and constructors also go into this class design
}

class Batsman : Player{
int runsScored, fiftyScored,hundredScored;
float battingAverage;
// a few methods and constructors are also part of this class
}

class Bowler : Player{
int oversBowled,wicketsTaken, runsGiven;
float bowlingAverage;
//a few methods and constructors are also part of this class
}

Now I want to create a new class called AllRounder. Going by the real-time characteristics of this object, an AllRounder in cricket is someone who is both a batsman and a bowler. As such I would have to create the AllRounder Class which has both Batsman and Bowler as its base classes.

Here is where I am starting to face the problem.

I understand that C# does not support multiple inheritance, but then again Multiple Inheritance can be achieved using Interfaces. Now every book stops with just this and gives a simple example on the same, but I havenít found a proper suggestion/solution to this problem of mine (I am told that the problem I am referring to, is named as Diamond Inheritance Problem)

Until I was playing around with C++, this wasnít a problem at all for me, since C++ supports multiple inheritance and also because Diamond Inheritance problem was solved by C++ by the help of virtual inheritance, which helped me inherit just one copy of the Player class on to my AllRounder class (without having to worry about me getting a copy of the Player class attributes through both the Batsman class and the Bowler class which are to be the base classes of AllRounder class as per my class design)

All people to whom I have approached with this problem, said Interfaces is my solution. But I understand that interfaces can only contain method signatures and cannot contain any data members. Java is a little bit different on this, the interfaces in the world of java lets you have data members also, but there also comes a limitation, the data members can only be constants.

My entire class design is trying to map the real time entities and the way they are visualized into classes, but because of the fact that multiple inheritance is not supported, I am not able to proceed further.

Can someone please help me with this query ?