> 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.
[quoted text clipped - 8 lines]
> Member has a field called Status that tracks the status of that member.
> What is the proper way to create this class?
How many possible statuses are there? I would probably either use an
enum for the MemberStatus, or a class but with a private constructor
and a few predefined immutable values (so that you can still have both
the code and the description).
I certainly wouldn't put them both in Member.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
BillG - 19 Oct 2007 22:30 GMT
There could be 5 or 6 different statuses and I don't necessarily know what
they are. They could be different for different clients so I can't create
an enum. This is also just an example. It could be a case like this
public class Customer
{
private int m_Id;
private string m_CustomerName;
private string m_SalesPersonId;
or
private SalesPerson m_SalesPerson;
}
public class SalesPerson
{
private string m_Id;
private string m_LastName;
private string m_FirstName;
private string m_Telephone;
}
>> I have pondered this question often and have done it several ways but I
>> am
[quoted text clipped - 16 lines]
>
> I certainly wouldn't put them both in Member.
Jon Skeet [C# MVP] - 19 Oct 2007 22:39 GMT
> There could be 5 or 6 different statuses and I don't necessarily know what
> they are. They could be different for different clients so I can't create
> an enum.
Ah, rats. Ah well - it would save memory to have a fixed set of
flyweights, but loading them isn't too bad.
> This is also just an example. It could be a case like this
>
[quoted text clipped - 9 lines]
>
> }
I'd prefer a proper class reference, again.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Bill,
Why are you not just using booleans (bit in SQL server)?
Seems for me to make it difficult especially to maintain not using the right
types for the meant purposes.
Cor