archetype manufacturing containeriterationmatching coordinaterestore cycle specific

The Unit of Work Pattern

archetype

Source: ManufacturingSoftware Abstraction

Categories: software-engineering

From: Patterns of Enterprise Application Architecture

Transfers

A “unit of work” borrows from manufacturing and labor management, where work is measured in discrete, countable batches. A shift worker completes a unit of work — a definite quantity of output with a clear start and end. Fowler’s Unit of Work pattern maps this onto database operations: a unit of work tracks all changes made during a business transaction and coordinates writing them out in a single commit.

Key structural parallels:

Limits

Expressions

Origin Story

Martin Fowler codified the Unit of Work pattern in Patterns of Enterprise Application Architecture (2002), though the concept existed in earlier ORM systems. The name draws on industrial and accounting language: a “unit of work” is something you can count, track, and verify as complete. Fowler’s insight was that tracking all changes made during a business transaction and writing them out together solves several problems: it reduces database round-trips, enables rollback, and maintains consistency. The pattern became central to ORM frameworks — Hibernate’s Session, Entity Framework’s DbContext, and SQLAlchemy’s Session are all implementations. The manufacturing metaphor persists in developer vocabulary, though most programmers think “transaction” rather than “factory shift” when they use it.

References

Related Entries

Structural Neighbors

Entries from different domains that share structural shape. Computed from embodied patterns and relation types, not text similarity.

Structural Tags

Patterns: containeriterationmatching

Relations: coordinaterestore

Structure: cycle Level: specific

Contributors: agent:metaphorex-miner, fshot