Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > BOOK: Professional ASP.NET Design Patterns
| Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET Design Patterns
This is the forum to discuss the Wrox book Professional ASP.NET Design Patterns by Scott Millett; ISBN: 978-0-470-29278-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET Design Patterns section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 3rd, 2014, 06:19 PM
Registered User
Points: 62, Level: 1
Points: 62, Level: 1 Points: 62, Level: 1 Points: 62, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Posts: 9
Thanks: 0
Thanked 2 Times in 2 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.
  #2 (permalink)  
Old March 5th, 2014, 05:52 PM
elbandit's Avatar
Wrox Author
Points: 599, Level: 8
Points: 599, Level: 8 Points: 599, Level: 8 Points: 599, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2007
Location: Southsea, Portsmouth, Hampshire, United Kingdom.
Posts: 107
Thanks: 10
Thanked 17 Times in 15 Posts
Default

Hi dpant,

In my new book (http://www.amazon.com/Professional-D...dp/1118714709/) I look present a slightly better way to use repository pattern and unit of work with NHibernate. The book is not out yet but you can get the source code here https://github.com/elbandit/PPPDDDCh...bernateExample.

Hope this helps
Scott
  #3 (permalink)  
Old March 7th, 2014, 10:28 AM
Registered User
Points: 62, Level: 1
Points: 62, Level: 1 Points: 62, Level: 1 Points: 62, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Posts: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Thank you for your reply.

Yes, I see you pass the ISession as a parameter to the repository considering it as the unit of work. Now, this makes sense.

As far as application structure is concerned , I truly hope your new book is much simpler than this one.

Thank you again, for replying.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extending the case-study be_yeti BOOK: Professional ASP.NET Design Patterns 1 September 20th, 2011 08:46 AM
Case Study I5commuter BOOK: Professional Microsoft SQL Server 2008 Integration Services ISBN: 978-0-470-24795-2 0 July 3rd, 2009 11:55 AM
Ch13 Case Study 2 alecwood BOOK: Beginning Access 2003 VBA 0 October 18th, 2007 05:40 AM
Case Study 1 - VBA 2003 adams77 BOOK: Beginning Access 2003 VBA 2 September 28th, 2005 08:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.