O'Reilly logo

Building Enterprise Applications with Windows® Presentation Foundation and the Model View ViewModel Pattern by Raffaele Garofalo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Unit of Work

If you plan to write your DAL using an O/RM, you won’t need to put a lot of effort into writing custom SQL code and custom transactional code to save or retrieve entities. On the other hand, you do need a solid “orchestrator” which will be in charge of entity status. For example, you need to know whether an entity is new, or whether a requested entity is already in memory or needs to be retrieved from the data store.

Martin Fowler introduced the concept of the Unit of Work (UoW) (see Chapter 2). The UoW is in charge of maintaining a list of objects affected by a business transaction and coordinating writing out changes and resolving concurrency problems.

Each of the O/RMs discussed in the previous section have a UoW concept at their ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required