Skip to content

Interface + internal implementation or extension method? #193

Locked Answered by PaoloPia
jansenbe asked this question in Ideas
Discussion options

You must be logged in to vote

That's indeed an interesting discussion. However, I'm not in favor of moving from interface and instance methods to extensions methods. There are multiple reasons supporting my previous sentence. Let me try to explain the reasoning behind.

  1. Let’s start with the definition of extension method (https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods): Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. It means that the purpose of the extension methods is to allow developers to extend types defined by someone else (most likely in another asse…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jansenbe
Comment options

jansenbe
Oct 19, 2020
Maintainer Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants