Use interfaces as part of your domain model that represents
repositories or query objects. Provide concrete nhibernate-dependent
implementations in a separate assembly. Use some form of dependency
injection to let the domain model access the implementations without
direct reference.

This way you don't have to spend time creating a direct wrapper on
nhibernate, that will still make you have a dependency on nhibernate
(in that it may be difficult to port to other frameworks).

/Oskar


2009/9/25 Nexus <[email protected]>:
>
> Hi,
>
> I would like to abstract away from nhibernate.Criterions.ICriterion,
> to prevent a leak in my upper layers, does anyone has tried to
> implement/wrap its own IMyCriterion that can be resolved to an
> ICriterion ???
>
> The context of this question lies in the creation of query objects, i
> would like to create templates for properties, similar to Nhibernate
> Criteria builder project, except i don't like my domain to have an
> nhibernate reference
>
>
> Kind regards
> >
>

--~--~---------~--~----~------------~-------~--~----~
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