How can i model a hierarchical relationship in a DDD domain model? In my app I have a Organization entity and organizations can have divisions and divisions in turn can have child divisions. The nesting depth is arbitrary. How should I design my entities and repositories?
Share
A simple model could look something like:
There are other approaches as well depending on specific needs. If using an ORM such as NHibernate to implement repositories take a look at this to see how to store and query hierarchical relationships.