Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > BOOK: Professional ASP.NET Design Patterns
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 3rd, 2014, 05:19 PM
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
  #2 (permalink)  
Old March 5th, 2014, 04: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: 11
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
Reply With Quote
  #3 (permalink)  
Old March 7th, 2014, 09:28 AM
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

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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 09:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.