Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the source of the unit of work pattern?

On this page I read the following:

A unit of work is a design pattern described by Martin Fowler

Did Martin Fowler discover this pattern before the Hibernate developers and is he the only source of describing this pattern?

like image 956
darpet Avatar asked Aug 20 '10 15:08

darpet


1 Answers

Did Martin Fowler discovered this pattern before hibernate boys and is Martin the only source of describing this pattern?

The concept of Unit Of Work is a central concept of ORMs and has been described by Scott Ambler in his outstanding research on ORM (which dates back to 1998), notably the famous ORM sister papers (now split in several documents):

  • The Design of a Robust Persistence Framework for Relational Databases (older version here)
    • 5.1.4 The PersistentTransaction Class <-- this is it
  • The Object-Relational Impedance Mismatch
  • Mapping Objects to Relational Databases: O/R Mapping In Detail
  • Choosing a Primary Key: Natural or Surrogate?

And to my knowledge, most modern ORMs are based on Scott Ambler's papers and share concepts:

  • TopLink has a unit of work, the UnitOfWork 1.
  • JDO has a unit of work, the PersistenceManager.
  • Hibernate has a unit of work, the Session.
  • JPA has a unit of work, the EntityManager.

So while this concept has emerged as a pattern which has been described by Fowler, Ambler's work clearly predates PoEAA.

1 Actually, TopLink has been created in the early 90's and thus predates Ambler's work, I just don't know when they introduced their unit of work implementation and if Ambler somehow influenced that or if this is resulting from the convergence of similar ideas.

like image 128
Pascal Thivent Avatar answered Oct 20 '22 18:10

Pascal Thivent