Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Structure Of Classes

$
0
0
I'm working on a program that has a Person class and a Business class. My program should track people and businesses that donate to a cause. So a donor can be either a Person or a Business but not all Persons and Businesses are donors. I still want to have objects for the people and businesses that do not donate so I don't ask them again.

Should I have a class, Donor, that is extended by Person and Business? I don't want to do a PersonDonor class and a BusinessDonor class as that extend Person and Business respectively since much of the code would be redundant.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>