What is Unit of Work design pattern?

Unit of Work is a design pattern to define business transactions.

A Unit of Work is a list of ordered operations that we want to run on a database together. Either all of these go together or none of these goes.

Most of the time, we use term business transaction in place of Unit of Work.

Egg. In case of money transfer from account A to B, the unit of work can be two operation Debit account A and Credit account B in a sequence. Both these operations should happen together and in right sequence.

Leave a Reply

Your email address will not be published. Required fields are marked *