unit of work
A pattern that collects the changes made during one business operation and commits them together, or not at all.
In more detail
A money transfer that debits one account and credits another must commit both or neither. In a web application one request usually forms one unit of work. In React's rendering engine the phrase has a different meaning: one small piece of rendering work for a single fiber, after which React can pause to let the browser respond.
Example
EF Core: a DbContext collects tracked changes and SaveChanges writes them in one transaction.Related terms
- DbContext — The EF Core class that represents a session with the database: it tracks entities, translates queries and saves changes as one unit of work.
- transaction — A group of database changes that succeed or fail together, so the data is never left half-updated.
- scoped lifetime — A service lifetime in which one instance is shared within a scope, which in ASP.NET Core means one HTTP request, then disposed.
- repository pattern — Putting all the code that reads and writes one kind of data behind a single object, so the rest of the app never talks to the database directly.
- atomicity — The property that a group of changes happens completely or not at all, with no half-finished state ever visible.
- Fiber — The internal object React keeps for each component instance, and the name of the React 16+ engine built on those objects.
- time slicing — Splitting a long job into short slices and giving control back to the browser between them so the page stays responsive.
- concurrent rendering — React ability to prepare several versions of the UI at once and to pause, resume or abandon rendering work so urgent updates are handled first.
Taught in
- Classes, Interfaces, and Object-Oriented C# — Modern .NET Core, C# & Enterprise Microservices
- The Dependency Injection Container: Scopes and Lifetimes — Modern .NET Core, C# & Enterprise Microservices
- Entity Framework Core: Code First and Migrations — Modern .NET Core, C# & Enterprise Microservices
- Querying, Change Tracking, and Saving Data — Modern .NET Core, C# & Enterprise Microservices
- The Repository Pattern — Modern .NET Core, C# & Enterprise Microservices
- Database Access & Migrations: ORM & Data Layers — Production Full-Stack Engineering
- React Fiber Architecture: Work Units, Priority And Commits — React 19 & Modern Component Architecture
- Concurrent Mode: Interruptible Work And Lane Priority — React 19 & Modern Component Architecture