B
BillG
I have pondered this question often and have done it several ways but I am
wondering what is the correct OO way to handle this.
In my SQL Sever database I have the following tables for example,
Member and MemberStatus
Member status has two fields StatusCd and Description. ex. 'A' and
'Active', 'I' and 'Inactive'
Member has a field called Status that tracks the status of that member.
What is the proper way to create this class?
public class Member
{
private string m_SocSecNo;
private string m_LastName;
private string m_FirstName;
(A) private string m_StatusCd or
(B) private MemberStatus m_MemberStatus
(C) private string m_StatusCd;
private string m_StatusDescription;
}
public class MemberStatus
{
private string m_StatusCd;
private string m_Description;
}
Thanks
Bill
wondering what is the correct OO way to handle this.
In my SQL Sever database I have the following tables for example,
Member and MemberStatus
Member status has two fields StatusCd and Description. ex. 'A' and
'Active', 'I' and 'Inactive'
Member has a field called Status that tracks the status of that member.
What is the proper way to create this class?
public class Member
{
private string m_SocSecNo;
private string m_LastName;
private string m_FirstName;
(A) private string m_StatusCd or
(B) private MemberStatus m_MemberStatus
(C) private string m_StatusCd;
private string m_StatusDescription;
}
public class MemberStatus
{
private string m_StatusCd;
private string m_Description;
}
Thanks
Bill