A question of being Object Oriented vs Relational

A question of being Object Oriented vs Relational

Old forum URL: forums.lhotka.net/forums/t/1268.aspx


DeHaynes posted on Tuesday, September 19, 2006

   I find myself trying to decide whether to follow the layout of my database or the real life relationships. 

   In my database, I have a table called tblContacts.  This is for any human being in the system.  I also have a tblAddresses for any addresses in the system.  I am at the point where I am coding the BOs to keep track of our company franchisees.  So I am wondering if I should make a ContactAddress BO or a FranchiseeAddress BO.

   Remember that I said the Contacts are for any humans in the system.  Well that means that they will also house a record for each employee in the company or any other system we implement in the database.  If I create a ContactAddress BO I can use it as a child object in various other BOs.  If on the other hand I create a FranchiseeAddress BO, I will only use it as a child in my Franchisee BO (of course inside a FranchiseeAddresses collection BO).  I will then have to make a seperate BO for each type of entity that uses the tblCotnacts and tblAddresses tables.

   So my thoughts are to lean towards a ContactAddress BO, but I have seen a lot of posts about sticking as close to possible to the real world objects.  Do any of you see a downfall of using a ContactAddress over

RockfordLhotka replied on Tuesday, September 19, 2006

You may want to read this thread, as it covers your question fairly well I think

http://forums.lhotka.net/forums/thread/6449.aspx

DeHaynes replied on Tuesday, September 19, 2006

WOW that is deep.  I still don't think I understood it all. 

I think I am sticking with my Contacts Object

malloc1024 replied on Tuesday, September 19, 2006

An address is an address.  Is there really a big difference in behavior between a franchise address and a contact address?  Ideally, and address class should be able to be used by a franchise or contact without any issues.  If there are small behavioral differences, you can change the behavior of the address class dynamically to suit your needs.

Copyright (c) Marimer LLC