What are the best practices for using Extension Methods in .Net? *

Question

I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a point).

So, what do you think are the best practices for employing Extension Methods?

Should development teams create a library of extension methods and deploy them across various projects?

Should there be a collection of common extension methods in the form of an open source project?

Update: have decided to create an organization wide extension methods library

Answer

I would recommend that you check out the following blog article:

http://blogs.msdn.com/vbteam/archive/2007/03/10/extension-methods-best-practices-extension-methods-part-6.aspx

It has some guidelines for how to use extension methods.

I wrote it back when I used to work for Microsoft, where I was the guy on the VB compiler team that implemented extension methods.

< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/3147/" >What are the best practices for using Extension Methods in .Net?< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment