Wrox Programmer Forums
|
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
 
Old October 21st, 2011, 06:21 AM
Registered User
 
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default iunitofwork / iunitofworkrepository

Hey Scott,
neat book, learning a lot from it and your other arch books. At the moment I'm seeking a bit of clarification.

In the book chapters itself (not the case study which there are errors as _uow is not hooked into) you have an Iunitofwork iface which gets implemented by nhibernate which essentially delgates down to session.save/session.delete etc.

However in the base repository class you call, registernew etc. while always passing in null for an implementation of Iunitofworkrepostory, why is this? It is just another layer of abstraction in case a different ORM does it differently?
 
Old December 5th, 2011, 12:16 PM
elbandit's Avatar
Wrox Author
 
Join Date: May 2007
Posts: 107
Thanks: 10
Thanked 17 Times in 15 Posts
Default

hi Mr David,

Thanks for buying the book. Yes the implementation is to support a non ORM scenario, if you read the Unit of Work section in the book at page 198 it describes the roles of IUnitOfWorkRepostory and later in the chapter why is isn't needed for ORMs. I tend to now favor having the transactions hook up to the start and end of a request (session per request http://code.google.com/p/walkme/sour...equest+.cs?r=8) or before and after action on a controller (like http://ayende.com/blog/4809/refactor...t-transactions) so that I don't have to keep explicitly calling commit.

let me know if you need any more details.

Cheers
Scott









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