N
netnet
This is an example of the concept I seem to be having a tough time w in C#:
Payment
-amount
Check : Payment
-checkNumber
CreditCard : Payment
-ccNumber
-ccExpiration
Now when I go to use this class structure .....I have to create a container,
populate it, AND all methods have to be implemented on payment at least as
abstracts...which seems like a lot of work.
I dont really need Payment or Check to know anything about ccExpiration for
example.
This is how I have been doing it ...Please let me know if you have cleaner
approach
Payment[] aPayment = new Payment[1];
if(someCondition)
aPayment[0] = new CreditCard(info);
else
aPayment[0] = new Check(info);
Theres a better way right?
Thanks again
Sean
Payment
-amount
Check : Payment
-checkNumber
CreditCard : Payment
-ccNumber
-ccExpiration
Now when I go to use this class structure .....I have to create a container,
populate it, AND all methods have to be implemented on payment at least as
abstracts...which seems like a lot of work.
I dont really need Payment or Check to know anything about ccExpiration for
example.
This is how I have been doing it ...Please let me know if you have cleaner
approach
Payment[] aPayment = new Payment[1];
if(someCondition)
aPayment[0] = new CreditCard(info);
else
aPayment[0] = new Check(info);
Theres a better way right?
Thanks again
Sean