Avoid This Common Mistake in DDD Modeling @zoran-horvat
Avoid This Common Mistake in DDD Modeling  @zoran-horvat
Uploaded February 2024 | Updated September 2026, 3 weeks ago
Become a sponsor to access source code ► patreon.com/zoranhorvat
Join Discord server with topics on C# ► codinghelmet.com/go/discord
Enroll course *Beginning Object-Oriented Programming with C#* ► codinghelmet.com/go/beginning-oop-with-csharp
Subscribe ► youtube.com/channel/UCxsWfh8LCcn55mFB6zGBT1g?sub_confirmation=1
Watch *Domain-Driven Design Fundamentals* course by Steve Smith and Julie Lerman at Pluralsight app.pluralsight.com/library/courses/fundamentals-domain-driven-design/table-of-contents
Watch *Eric Evans on the Entity Equality Methods* at Pluralsight ► app.pluralsight.com/ilx/video-courses/c5e09de0-77a0-4e66-a31e-619fa96da04a/602eafad-1902-4b7d-a83c-f017e9ced07f/3234c848-8606-4b17-9f23-4d2dd348d355

If you are applying the Domain-Driven Design, you implement entities and value objects all day. If so, you must have encountered this situation: Almost every video, article, or online resource will teach you to override Equals and GetHashCode in an entity in such a way as to proclaim two entities equal if their identities are equal.
This may be a surprise if you haven't heard it before, but that implementation is wrong. If you are guilty of it, as so many programmers are, it is the perfect time to start removing that bug from your code.
This video explains why comparing two entities for equality is impossible, let alone only comparing their IDs and ignoring other attributes.
By the time you finish watching this video, you will already start feeling better about DDD.

00:00 Intro
00:37 The wrong Entity base
03:11 Understanding the mistake
04:55 Why not Equals?
06:45 The correct Entity base
09:56 Outro

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⭐ CONNECT WITH ME 📱👨

🌐Become a patron ► patreon.com/ZoranHorvat
🌐Buy me a Coffee ► ko-fi.com/zoranhorvat
🗳 Pluralsight Courses ► codinghelmet.com/go/pluralsight
📸 Udemy Courses ► codinghelmet.com/go/udemy
📸 Join me on Twitter ► twitter.com/zoranh75
🌐 Read my Articles ► codinghelmet.com/articles
📸 Join me on LinkedIn ► linkedin.com/in/zoran-horvat
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
👨 About Me 👨
Hi, I’m Zoran, I have more than 20 years of experience as a software developer, architect, team lead, and more. I have been programming in C# since its inception in the early 2000s. Since 2017 I have started publishing professional video courses at Pluralsight and Udemy and by this point, there are over 100 hours of the highest-quality videos you can watch on those platforms. On my YouTube channel, you can find shorter video forms focused on clarifying practical issues in coding, design, and architecture of .NET applications.❤️
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⚡️RIGHT NOTICE:
The Copyright Laws of the United States recognize a “fair use” of copyrighted content. Section 107 of the U.S. Copyright Act states: “Notwithstanding the provisions of sections 106 and 106A, the fair use of a copyrighted work, including such use by reproduction in copies or phono records or by any other means specified by that section, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright." This video and our youtube channel, in general, may contain certain copyrighted works that were not specifically authorized to be used by the copyright holder(s), but which we believe in good faith are protected by federal law and the Fair use doctrine for one or more of the reasons noted above.

#csharp #dotnet #domaindrivendesign
Avoid This Common Mistake in DDD ModelingHere Is How I Configure the Option Mapping Using EF CoreMake Domain Rules Explicit In Any Business ApplicationMaster the Design of Classes (Part 5)The Encapsulation Lose-Lose GameDeep Dive on Locks & Deadlocks for Application DevelopersLINQ SelectMany Is Slowing Your Application – Here’s How to Fix ItC# Curly Braces vs Expression-Bodied Methods: When to Use Which?Advent of Code 2024 Day 2 - Full Solution5 Sure Signs Youre No Longer Junior ProgrammerCan You Avoid the Nightmare Scenario?Stop Forcing Surrogate Keys in EF Core: When Natural Keys Win
Zoran on C# |

Avoid This Common Mistake in DDD Modeling

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER