Avoid This Common Mistake in DDD Modeling

Zoran on C# February 7, 2024
Video Thumbnail
Zoran on C# Logo

Zoran on C#

View Channel

About

Hello everyone! My name is Zoran Horvat. I am a consultant, developer, and software architect, author at Pluralsight, Udemy, and YouTube. In this channel, you will find advice on development and architecture in .NET and C#. All opinions expressed in this channel are my own. They do not represent my employer (which I do not have anyway), nor that of any technology providers.

Video Description

Become a sponsor to access source code ► https://www.patreon.com/zoranhorvat Join Discord server with topics on C# ► https://codinghelmet.com/go/discord Enroll course *Beginning Object-Oriented Programming with C#* ► https://codinghelmet.com/go/beginning-oop-with-csharp Subscribe ► https://www.youtube.com/channel/UCxsWfh8LCcn55mFB6zGBT1g?sub_confirmation=1 Watch *Domain-Driven Design Fundamentals* course by Steve Smith and Julie Lerman at Pluralsight https://app.pluralsight.com/library/courses/fundamentals-domain-driven-design/table-of-contents Watch *Eric Evans on the Entity Equality Methods* at Pluralsight ► https://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 ► https://www.patreon.com/ZoranHorvat 🌐Buy me a Coffee ► https://ko-fi.com/zoranhorvat 🗳 Pluralsight Courses ► https://codinghelmet.com/go/pluralsight 📸 Udemy Courses ► https://codinghelmet.com/go/udemy 📸 Join me on Twitter ► https://twitter.com/zoranh75 🌐 Read my Articles ► https://codinghelmet.com/articles 📸 Join me on LinkedIn ► https://www.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

No Recommendations Found

No products were found for the selected channel.