473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Where to Implement Unit of Work pattern?

I'm considering implementing the Unit of Work pattern that is in
Fowler's PoEAA book.

First, two assumptions:

1. It's per session thus must be a singleton.
2. I will store it in session.

Now, where is the best place to initialize this unit of work? I'm
thinking in an http module and placing it on a running thread using
CallContext. Then it should be available to my middle-tier.

Can anyone verify I'm on the right track or offer suggestions? Thank
you.
Nov 18 '05 #1
1 3525
steven wrote:
I'm considering implementing the Unit of Work pattern that is in
Fowler's PoEAA book.

First, two assumptions:

1. It's per session thus must be a singleton.
2. I will store it in session.

[...]

I wouldn't put in the session -- this tightly couples your BLL/DAL with your
Web UI layer, which is a no-no. You couldn't even run a simple NUnit test
for your Unit of Work.

Why not follow Fowler's suggestion and use a thread-local Registry? Or is
your middle layer only accessible through remoting?

Cheers,

--
Joerg Jooss
jo*********@gmx.net
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: michele.simionato | last post by:
Paul Rubin wrote: > How about macros? Some pretty horrible things have been done in C > programs with the C preprocessor. But there's a movememnt afloat to > add hygienic macros to Python. Got any...
5
by: charliewest | last post by:
I've implemented the USING statement to ensure that my newly created sql connection closes when my method is finished using it. The USING statement is wrapped in try/catch error handling statement....
3
by: Rich Denis | last post by:
Hello, I am in need of assistance trying to figure out how to 'Unit Test' my Event Based Async Pattern (http://msdn2.microsoft.com/e7a34yad.aspx) web service calls. Specifically how to test the...
5
by: VvanN | last post by:
hi, fellows I'd like to intruduce a new unit test framework for C++ freely available at: http://unit--.sourceforge.net/ It does not need bothering test registration, here is an example ...
7
by: sunny | last post by:
Hai, can anyone implemen this problem.I am unable to implement.i tried but i am going out of the design pattern. Implement the Factory Design Pattern for the following scenario: Base class =...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
4
by: JS | last post by:
I have an application with many user controls and forms which display measurements in whatever the current unit system is. The current unit system is kept in my 'Units' static class as...
37
by: Phlip | last post by:
1230987za wrote: Kanze is a classically-trained "unit tester". In some circles "unit" is a QA concept - specifically, if a test fails, you only need to inspect one unit. So "units" are...
20
by: David Thielen | last post by:
Hi; When we add a reference to a web app, where is that information stored? There is no project file, it's not in the web.config or solution file. ??? - thanks - dave ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.