Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a two entity objects Site and Customer where there is a many to many relationship. I have read you try not to model this in DDD as it is in the data model and go for a unidirectional flow.

If I wanted to show this in UML, would I show it as it is in the data model:

Site * ----->*Customer but the direction arrow gives the flow?

or as following

Site ----->*Customer But then this would imply that Customer can only go in one site.

share|improve this question
"I have read you try not to model this in DDD"? Can you provide the quote or the link? – S.Lott Dec 18 '11 at 22:35
Is this the same question?… – S.Lott Dec 18 '11 at 22:38
@S.Lott "I have read you try not to model this in DDD" => as far as I remember, towards the first third of the DDD book, Evans explains that bidirectional associations (either many-to-many or one-to-many) are cumbersome and he gives examples of how to turn them into one-directional associations. Namely, a Site's Customers collection must be kept in sync with all the Site collections of the Customers which might be hard to achieve. – guillaume31 Sep 3 '12 at 13:39

The sense I get from this article is that within the realm of DDD, Site--->*Customer does not indicate that a Customer cannot be related to more than one site. Rather, it simply indicates that a Site can have multiple Customers (as in a list of them) whereas, the Customer treats each Site as a unique interaction and does not maintain a list of Sites.

This makes some sense. The Site is a Site, whether or not anyone visits it. The Customer, on the other hand, only becomes a Customer upon visiting a Site.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.