Object-relationship modelling: Difference between revisions

Content deleted Content added
No edit summary
Acm (talk | contribs)
then -> than
Line 7:
Now, there is a table that is closely related and is parent to the person table and that is the company table. Assuming that a person may only work for one company at a given time it could be expressed that the company "owns" the person. Each column in the company table would become a property of the object table. To avoid name collisions it is common to prepend the table name to the property name when the object is created, i.e. Person.CompanyCity, Person.CompanyDomain so on and so forth.
 
Let's add to this the prospect of a child table. Ignoring the fact that it is possible for more thenthan one person to live at a given address and that one person can have more thenthan one address let us assume that an address has just one person living there, and that each person can have multiple addresses. So, you see that the multiple addresses becomes a collection of addresses for each person. Thus; Person.Address[0].StreetName, Person.Address[0].City.
 
Sometimes we get another type of relationship between tables which is a joining table. If a table is a mapper between two static objects, ie person(s) to address(es) and alternatively address(es) to person(s) then the relationship can be expressed as Person.Address[0].StreetName or a shorter notation could be devises Person.AddressStreetName.