Hi TonyC, 1. ::One slight difference though What you have is very close to what I have currently in the database. One slight difference though. If someone is from a country that does not have state/province, -Yes. This is business requirement for some foreign
countries that I did not see from your requirement. No problem. That's was the reason I did not include Country object into the Person class. So the Person table --Person table id (personid) firstname middle name lastname stateid (Referential Integrity with
State table) countryid (Referential Integrity with Country table) -Then "how do you enforce the referential integrity for optional state?" this is the key point here because state can have NULL value or a value matching the state table. How do you enforce
RI for NULL value unless you have one null value in your state table? which implies there must be one NULL value in the Country table by the reason of RI between Country and State tables. -In the case for a person with a state and country, then that person
will have 2 values for those 2 columns and the state table will also have a country value as well. 2. This point 2 depends on the point 1's outcome. However, I've a question: :: --Person class id (personid) int firstname string middle name string lastname
string State object of State class Country object of Country class The fact we have Country object would handle point 1 (business rule). But then the programming implication is we have to check if state object is not optional (not null/nothing) then we have
to ignore country object else ignore state and use country object. Is this what you have in mind? 3. We'll have a comprehensive look again based upon your answer for point 1 and 2.
Where there is a will, there is a way.
and where there is a team, there is more than one way.
Phuoc
Participant
1150 Points
230 Posts
Re: Class Design
Aug 05, 2003 03:22 PM|LINK
and where there is a team, there is more than one way.