Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't have an answer as far as what design will best jive with NHibernate, but I wanted to comment because this reminds me a lot of Rob Conery's discussion on Hanselminutes about Domain Driven Design.</p> <p>My visceral reaction is that something isn't right if your <em>pure</em> User contains Subjects at the same time your Subjects contain Users. I'd want to narrow it down to one or the other. Interestingly, Conery was discussing his storefront app and the debate over whether a product has categories or does a category have products. It turned out that <em>neither</em> was the case - it was actually a tangential relationship that would best be handled by a service in the application. (At least, this was the best DDD way of implementing it because it's how his customer related the entities.)</p> <p>So, DDD aside, I wonder if it would help you take a good hard look at what the true <em>pure</em> relationship is between Users and Subjects, and whether one even contains the other at all. Since I kinda don't like the idea of each of them containing the other, I would probably consider which child collection is used more often. When retrieving a User, do you often use its Subjects? Conversely, while a Subject may have users related to it, do you often use this collection when operating on a Subject object? If not, maybe the collection doesn't directly belong to it.</p> <p>Again, I can't attest to what design would work best with NHibernate, but I think this is something worth considering.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload