View Single Post
  #1 (permalink)  
Old March 3rd, 2014, 05:19 PM
dpant dpant is offline
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default UnitOfWork and NHibernate in Agathas case study

NHibernate has Unit of Work built in.

In the Agatha's case study, why do you insist on providing a UnitOfWork interface and a NHUnitofWork implementation class? You do not use it, after all!!!

I think, it was a copy and paste from Chapter 7, where you presented a sample UoW implementation using Dictionaries.

But, in the case study, where NHibernate is used, you never need it in your code:

- You never use the repository interface passed as parameter in the NHUnitOfWork class methods (Chapter 11, page 462).

- You pass the UoW as a parameter to the Repository but you never actually use it in the methods! (Chapter 11, page 463,464).

Instead, you always let the NHibernate session do the job, which of course is correct (since Session handles all the UoW implementation, itself):

SessionFactory.GetCurrentSession().XYZ


So, please, fix the sample code and the download files for the case study.

Thank you.
Reply With Quote