Question

Very new to FluentNHibernate, but I'm also excited about the area. I've recently started work on a new DAL using the aforementioned and have been reading up on the Repository pattern. I like the generic form this pattern takes and am looking to use this pattern in conjunction with the UnitOfWork pattern for session management.

I'm curious, is this the right direction to head? Should I be using UoW to create a pseudo-singleton NHibernate session? This question really dances around the topic of NHibernate session management. There is a UoW implementation available that I've taken a look at, although I'm also unclear if I should be working to implement this library, or abstract my own.

EDIT:

Just for re-clarification of the question:

Is it common practice to use the UoW pattern with the Repository pattern in a FluentNHibernate environment?

Was it helpful?

Solution

Yes, for a good example check out FubuMVC-Contrib's implementation of these.

OTHER TIPS

I see a lot of "can I do X with Fluent NHibernate" questions - just to clarify Fluent NHibernate sits on top of NHibernate and spits out those horrible XML mappings for you... it doesn't affect what you can and can't do with NHibernate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top