Enjoy Strongly Typed Code Again With Covariant Return Types @zoran-horvat
Enjoy Strongly Typed Code Again With Covariant Return Types  @zoran-horvat
Uploaded March 2024 | Updated September 2026, 2 weeks ago
Which part of object-oriented design is the hardest to get right?
A viable candidate for this infamous title is that delicate dance between abstract and concrete types we must go through in every single model we make.
C# has recently been enriched with an important feature that will help us balance abstract and concrete types: the covariant return types. But what is that feature?
In this video, you will learn how method overrides and interface implementations can return a more derived type than their base type specifies. This feature, almost trivial in its form, has a tremendous impact on the overall design. Once impossible, at least without a risky downcast, operating at the level of concrete classes where required and at the level of abstract types where allowed has become a reality.

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
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⚡️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 #objectorientedprogramming
Enjoy Strongly Typed Code Again With Covariant Return TypesNew Answer to the Oldest Interview QuestionGuess the Pattern!Even Fast Queries Can Crash Your DatabaseUnveil the Mystery of the Liskov Substitution PrincipleWhy C# Refuses to Compare CollectionsAvoid 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 Developers
Zoran on C# |

Enjoy Strongly Typed Code Again With Covariant Return Types

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER