unit of work

{{Short description|Concept in software engineering}}

{{distinguish|Work unit}}

{{distinguish|Joule}}

A unit of work{{Cite book |isbn=0-321-12742-0|author=Martin Fowler|language=en|title=Patterns of Enterprise Application Architecture}} is a behavioral pattern in software development. Martin Fowler has defined it as everything one does during a business transaction which can affect the database.{{citation|author=Martin Fowler|date=2002|isbn=0-321-12742-0|location=Amsterdam|publisher=Addison-Wesley-Longman|title=Patterns of Enterprise Application Architecture}} When the unit of work is finished, it will provide everything that needs to be done to change the database as a result of the work.

A unit of work encapsulates one or more code repositories[de] and a list of actions to be performed which are necessary for the successful implementation of self-contained and consistent data change. A unit of work is also responsible for handling concurrency issues,{{cite web|access-date=2018-03-08|author=Martin Fowler|language=en|title=Unit of Work|url=https://martinfowler.com/eaaCatalog/unitOfWork.html}}{{cite web|access-date=2018-03-08|language=en|title=Unit of Work|url=http://wiki.c2.com/?UnitOfWork|website=Portland Pattern Repository}} and can be used for transactions and stability patterns.[de]{{citation|author=Michael T. Nygard|date=2007|isbn=978-0-9787392-1-8|language=en|publisher=O’Reilly|title=Release It! Design and Deploy Production-Ready Software}}

See also

  • ACID (atomicity, consistency, isolation, durability), a set of properties of database transactions
  • Database transaction, a unit of work within a database management system
  • Equi-join, a type of join where only equal signs are used in the join predicate
  • Lossless join decomposition, decomposition of a relation such that a natural join of the resulting relations yields back the original relation

References