I want to ask if it make sense to use the unit of work with repositories on a project following the domain driven design philosophy and clean architecture or it doesn't make more sense and the generic repository pattern is sufficient?
Does The Unit Of Work Make Sense with Clean Architecture(DDD) Or Just The Repository Is Enough?
1.7k Views Asked by Muhamad Eissa At
1
There are 1 best solutions below
Related Questions in DOMAIN-DRIVEN-DESIGN
- How to use Interfaces in Domain Modelling DDD
- Domain driven design CQRS with multiple aggregates and bounded context
- Need more parameters in subclass overridden method
- Domain Driven Design: Aggregates Creating Aggregates
- How to deal with objects creation per request with high RPM node applications
- Async integration events needed sync
- In DDD where to handle interaction with external services that is part of business logic? In Domain Model or in Command Handler?
- How to split large time-related aggregates in DDD?
- One column with foreign key to multiple tables inf EntityFramework Core
- DDD & Clean Architecture: Why not define repositories in the application layer?
- Domain driven design: How to add a new database entry for an Aggregate?
- Integrate a versioning in aggregate
- when to pass args to the constructor of a service in ts?
- ASP.NET boilerplate module's dbcontext recreate abp main tables
- What's wrong with multiple entities in multiple bounded contexts pointing to the same identity?
Related Questions in UNIT-OF-WORK
- Domain driven design CQRS with multiple aggregates and bounded context
- "This session is provisioning a new connection; concurrent operations are not permitted" error using SQLAlchemy UOW and starlette_admin
- return View in .net core show that (IFeatureCollection has been disposed. Object name: 'Collection')
- How to implement GenericRepository and UnitOfWork with Identity.EntityFrameWorkCore and My own entities together
- MediatR Pattern CleanArchitecture with ASP.NET Core Web API
- C# ASP. NET web API design REST API call wrapper on existing Rest API
- How to write mock for unitofwork pattern
- How can I use Unit of Work to save two entities that are related 1:1 using Entity Framework Core and .NET? - SOLVED
- unit of work and repository update and add don't work
- Unit of Work has null repository property in Unit Test
- Repository Generic repository with Unit of Work for C# .net core with MongoDB
- Using default constructor with unit-of-work
- xUnit and moq with Unit of work and generic repository pattern in web api c#
- System.ObjectDisposedException: 'Cannot access a disposed context instance Using EntityFramework in NEt6
- Dot Net core 7 API including Identity, Dynamic role, claims in Repository pattern and UnitofWork
Related Questions in CLEAN-ARCHITECTURE
- Inject a class into a composable function using hilt
- Handling related Room entities with Clean Architecture in a multi-module project on Android
- In clean architecture, is the presentation layer allowed to communicate directly with the infrastructure layer?
- Clean architecture/OOP and optimization: how to organize for classes with same logic
- Flutter Clean Architecture communication between Use Cases and Blocs
- How to merge one LiveData to another
- How to handle sync distributed transaction in microservices?
- Need clarification on the AuditableEntityInterceptor class of the Clean Architecture solution template for C#
- cannot be provided without an @Provides-annotated method. public abstract static class SingletonC implements MyApplication_GeneratedInjector error
- Where do I put business logic when implementing CQRS pattern using Mediatr in a .Net Clean Architecture application?
- How to split a package into two, where one contains a trait, the second contains the implementation of this trait for an foreign type
- How to use view and data framework in swift clean architecture
- Sonar showing condition always false error though it is not
- How to centralize and specialize error handling across different layers in a multi-layered architecture?
- DDD & Clean Architecture: Why not define repositories in the application layer?
Related Questions in SPECIFICATION-PATTERN
- Validation in DDD requiring data from distinct bounded contexts
- How to filter entity's @OneToMany relationships with JPA Criteria API?
- What is the algorithm for checking logical equivalence of specifications?
- What is the most efficient way to filter a Pojo's OneToMany field retrieved in a JpaSpecification findAll?
- Spring Data Join Query using Specification in unrelated tables
- How to implement specification pattern in Rust?
- Ardalis.Specification and Azure Cosmos Database : What is the place where the query is applied? Cosmos Database or Application Memory?
- Is there a way to combine Specification classes in the Ardalis.Specification library?
- Specification pattern vs Always valid domain model
- How can one define the Selector in ardalis.Specification library?
- Proper aggregate design and complex specification query
- Does The Unit Of Work Make Sense with Clean Architecture(DDD) Or Just The Repository Is Enough?
- Specification pattern with Entity Framework generic repository pattern
- Make Specification pattern to search any property and condition
- DDD pass filters through multiple layers
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Martin Fowler describes a Unit of Work as
The Unit of Work pattern is listed under "Chapter 11: Object-Relational Behavioral Patterns" in his book. Thus it applies to the implementation of a repository.
In DDD you define aggregates and you usually pass the aggregate root to a repository to save it. Now it's up to the repository implementation if it uses a unit of work, because it must coordinate the execution of multiple statements send to the db, or not. Maybe you are using a document oriented NoSQL db and just post the serialized aggregate. In this case you don't have to coordinate actions, because there is only one update action - a put request.
I think that the Unit of Work pattern still makes sense in a clean architecture, but only in the repository implementation.