R
R.Balaji
Hi,
I am designing webservice component.
I am defining a class for the entity user.
UserId, UserName will be frequently used.
I have created a class for them
class UserHeader
{
public string userId;
public string userName;
public bool ValidateUserHeader();
}
All other user details are captured in another class. This will be rarely
used.
class UserDetail
{
public string userEmail;
public string userAddress;
pubilc string userCity;
public bool ValidateUserDetail();
}
I capture the user photo and his biodata document in another class
class UserBinary
{
byte[] biodata;
byter[] photo;
}
If I represent User class comprising of all the three classes like
class User
{
UserHeader uh;
UserDetail ud;
UserBinary ub;
}
Is this a correct approach?
I really want to create User class inheriting from all three classes.
But C# does not support multiple inheritances?
All this sub classes cannot be converted into interfaces also as it has the
data members.
Is there any better idea?
Regards,
R.Balaji
I am designing webservice component.
I am defining a class for the entity user.
UserId, UserName will be frequently used.
I have created a class for them
class UserHeader
{
public string userId;
public string userName;
public bool ValidateUserHeader();
}
All other user details are captured in another class. This will be rarely
used.
class UserDetail
{
public string userEmail;
public string userAddress;
pubilc string userCity;
public bool ValidateUserDetail();
}
I capture the user photo and his biodata document in another class
class UserBinary
{
byte[] biodata;
byter[] photo;
}
If I represent User class comprising of all the three classes like
class User
{
UserHeader uh;
UserDetail ud;
UserBinary ub;
}
Is this a correct approach?
I really want to create User class inheriting from all three classes.
But C# does not support multiple inheritances?
All this sub classes cannot be converted into interfaces also as it has the
data members.
Is there any better idea?
Regards,
R.Balaji