Search code examples
entitydomain-driven-design

DDD - ConcurrencySafeEntity what is it being used for


In the book Implementing domain driven design by Vaughn Vernon, he has employed a super type called ConcurrencySafeEntity, but couldn't find a specific explanation as to what is the exact purpose of this class, would appreciate any explanation in this regard


Solution

  • The ConcurrencySafeEntity class is a Layer Supertype which avoids code duplication for entities that needs to implement optimistic locking in order to prevent concurrency problems.