none
Question about Extension methods RRS feed

  • Question

  • Hi,

    I need to give a presentation on Extension methods to my team members. When I was going through MSDN, I found the following:

    "Implementers of class libraries should not use extension methods to avoid creating new versions of assemblies. If you want to add significant new functionality to a library, and you own the source code, you should follow the standard .NET Framework guidelines for assembly versioning."

    So, if Microsoft recommends to avoid extension methods, why introduce such feature? Although I appreciate the LINQ built-in extension methods line Where(), Select(), etc. I am asking this question assuming that some of my team members (who are interested in pulling my leg) may ask this question during presentation and I need to be prepared with good answer :)
    HR ------------------------------------------ "All that we are is the result of what we have thought." - Buddha
    Saturday, December 12, 2009 5:44 AM

Answers

  • That guidance sounds like it is aimed at people who ship libraries to people and have the source they could extend without needing to resort to extension methods.

    If you don't have that source extension methods can be useful.

    [)amien
    Sunday, December 13, 2009 12:36 AM
    Moderator