Hi!
We have not solved delema about layered architecture. I ask for help
from more experienced NHibernate developers.

First of all, our application - it is a tree-like directory that
contains all entities, as Active Directory. Rights to the entitues,
are appointed by the rules of trees. In order to determine whether the
user has the right to an entity, we should check all personal rights,
and inherited rights assigned to the parents of entity. This can be
done only with the SQL query. Bypassing parents and rule extraction
using a transparent persistence, will lead a dozen requests. This is
an unacceptable rate for production. As well known pattern we delimit
HQL from the model to the repository. And it works well.

However, what is the way to use this template with recursive
operations such as copying an entity? Copying follows like this:
1. Repository requests all rights to entity and his parents
2. A helper object AccessManager gets rights, analyzes them according
to the rules of inheritance and gives the answer, such as "copying
allowed"
3. Object successfully copies itself and recursively calls the
operation for children

The first part is the part  of persistence layer, the second and third
part is business logic. The point is how to call the first part in the
third part at the time of recursive call and not to mix business logic
and persistence? Is it possible?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en.

Reply via email to