I'm not sure of the proper nomenclature to describe my question, so let me just jump into an example. Let's say that we're modeling a scenario where:
- A Vendor can have multiple Customers
- A Vendor can have multiple Employees
- An Employee may only do work for one of the Vendor's Customers
- An Employee's only relationship with a Customer is via the Vendor
For simplicity, let's ignore the myriad other real-world employment scenarios, and just say that there are contractual reasons for those last two constraints (e.g. protect intellectual property, non-compete).
Based on my meager UML skills, I'd be inclined to model these relationships as shown in the diagram below, which I believe is incorrect:
Specifically, I think that this diagram allows for an Employee to do work for many of the Customers, which violates the third constraint listed above. My question is:
- What is the proper way to depict the constraint that an Employee may only be associated with one of the Customers?
Thank you in advance for your help.
[UPDATE]
Based on answers/comments, I'm including an updated example of a diagram that I believe to be more correct:
Note the new relationship directly from Employee to Customer, which shows the cardinality from the third bullet above.
This still does not clearly convey that the Employee interacts with the Customer only by virtue of the Vendor; to me, the Employee could have a day job with Vendor, and be moonlighting with Customer. A comment on this post suggests adding an annotation to clarify.