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
WOW that is deep. I still don't think I understood it all.
I think I am sticking with my Contacts Object
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