I would like to get some feedback on the different ways of handling model integrity across entities.
Take a security model containing users and groups as an example. Users are members of any number of groups. The administrator user is a special case, and should always be a member of all groups. Thus whenever a new group is created at runtime, we need to ensure that the administrator user is a member of this new group. Possible soultions: 1. Define a GroupService class that takes references to IRepository<Group> and IRepository<User>. Define a NewGroup method that creates the new group, and makes the administrator user a member. This is easy to implement but need but not foolproof. 2. Subscribe to the NHibernate pre-insert event for the User, and do the special processing here, probably using the GroupService instantiated via service locator. This seems like a more foolproof option. 3. Something else? What method are you using maintain your model integrity across entities? Cheers Alan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
