I am running into a problem that I have a CreditCard class, which has a property called "CardType". When I create a "VISA" credit card object, I set the CardType property to "VISA" which is a string.
Another approach is define a enumerate type of credit card type, so I can avoid any typo error.
But my problem is everytime I add a new credit card company, I need to edit the code and recompile for the above two approaches.
I wonder is there any way of design or implementation can avoid the above clumsy process. Let say I can just change an XML file node and reload the file.
Another approach is define a enumerate type of credit card type, so I can avoid any typo error.
But my problem is everytime I add a new credit card company, I need to edit the code and recompile for the above two approaches.
I wonder is there any way of design or implementation can avoid the above clumsy process. Let say I can just change an XML file node and reload the file.