Company & Contact

I hope someone (or some people) can help us with the problem that we have been facing for several days. How to organize our business objects taking into account the attached diagram?

We are looking for any help (ideas on where and how to look for design templates / object models that we could use to solve this problem. Our situation is a little more complicated, but we tried to simplify it so that we can ask it.

Some details: Some companies have production lines, and some do not.
Each company has a contact list. If a company has at least one product line, some of these company contacts are also associated with at least one product line.
Multiple contacts are links (business / personal) for other contacts.
Each company and each contact can have zero or more addresses.

Thank you for your help in finding a more suitable solution (My assumption is that we will need to use several models / templates).

Entity Diagram

Larger view (flickr.com)

** (from the chart) Our company has employees / users of internal applications that are included in contacts, because they can also be links, etc.

+3
3

:

Organization
-id
-name
-description
-productLines ( collection object consisting of products)
-orgcontacts ( collection object consisting of contacts)
-addresses (of type Address, can be a collection depends on business rule)

Contact
-id
-name
-type (Business, personal, etc)
-parentID (null if no reference)
-adresses (Address or collection)

ProductLine
-id
-name
-prLineContacts ( collection object consisting of contacts)

, . ? , , . 1-1 , , .

+1

, :

Companies = [id, name]
Contacts = [id, name]
Products = [id, name]
Adresses = [id, details]

CompaniesContacts = [contact_id, company_id]
CompaniesProducts = [product_id, company_id]
AdressesContacts = [contact_id, address_id]

References = [contact_id, referenced] // referenced is also a contact_id

, UML. , , .

0

, .

We have the concept of Sites between a company and addresses that people can connect to one or more sites in our scheme and save the preservation of thousands of duplicate addresses. You can also refer to the customerโ€™s address directly in the address book.

Where do you store contact details?

0
source

Source: https://habr.com/ru/post/1707198/


All Articles