In designing a class for customer for example would it make sense to use an Enum for CustomerType?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That depends on other constraints. You haven’t told us enough about your model. For example, if different types of customers have different types of information associated with them, a class hierarchy will be better suited that an a mere enum.
In other cases, an enum will be fine or might even be preferred (simpler, reduced overhead …).