What is the proper Domain Model for this relationship?
-
(Cross posted from the c# forum) A Customer can have multiple Products and a Product can be assigned to zero to more Customers But, there are some items (such as BasePrice and DefaultPrefix) that are implicit to a customer-product relationship. In the database this can be modeled as Table Customer with Columns CustomerId, Name, etc. Table Product with Columns ProductId, Name, etc. Table CustomerProduct with Columns CustomerId, ProductId, BasePrice, DefaultPrefix, etc. How would you model this as Domain Objects? All I could think of is Customer ..CustomerId ..Name ..AssignedProduct[] Products Product ..ProductId ..Name ..Customer[] Customers AssignedProduct : Product ..Customer Customer ..BasePrice ..DefaultPrefix But that doesn't strike me as too slick (an Assigned Product has a Customer and a Customers[]???) and as this simplified example gets closer to what I actually have to model, this design starts to have problems among which is that NHibernate can't model some of this stuff