http://martinfowler.com/
Basically unit of work is transaction management. Within one transaction, we may pull data from database, make some changes, add new record, etc.
There are some important notes about unit of work and web application:
1. Unit of work should be unique for each request, i.e. unit of work cannot share between requests.
2. Unit of work should be share within one request, i.e. if you use unit of work from your controller and other places, that unit of work object should be the same if it is within one request.
Dependency Injection comes to rescue to make sure the above requirements are met. Dependency Injection provides life time management and resolving the dependencies. For our case, unit of work object's life time must be per request.
http://sdesmedt.wordpress.com/
my thanks to: http://jittuu.com/2012/2/9/
0 comments:
Post a Comment