<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-7106856618803377357.post2007294977726220559..comments</id><updated>2010-10-29T15:57:16.408+02:00</updated><category term='Visual Studio'/><category term='Kindle'/><category term='Microsoft'/><category term='Patterns and Practices'/><category term='IE6'/><category term='DbC'/><category term='Amazon'/><category term='Programming by Contract'/><category term='Spec#'/><category term='Sysinternals'/><category term='Generics'/><category term='NonNull'/><category term='Null'/><category term='ASP.NET'/><category term='C#'/><category term='PowerShell'/><category term='WCSF'/><category term='WCF'/><category term='VS2010'/><category term='IE'/><category term='Internet Explorer'/><category term='NonNullable'/><category term='ITU'/><category term='JSON'/><category term='C5'/><category term='WPF'/><category term='Design by Contract'/><category term='Nullable'/><category term='.NET'/><title type='text'>Comments on Johannes Hansen's Blog: Extension Types for easier (and strongly typed) At...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.johannesh.dk/feeds/2007294977726220559/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default'/><link rel='alternate' type='text/html' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html'/><author><name>Johannes Hansen</name><uri>https://profiles.google.com/115933388913964922464</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-a6hlRGNmFrM/AAAAAAAAAAI/AAAAAAAABPw/vOZEeBWKxyk/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7106856618803377357.post-8650248287561826610</id><published>2010-10-29T15:57:16.408+02:00</published><updated>2010-10-29T15:57:16.408+02:00</updated><title type='text'>Thanks for sharing.
It would be nice if C# allowed...</title><content type='html'>Thanks for sharing.&lt;br /&gt;It would be nice if C# allowed defining extension methods based on attributes. That way marker interfaces will be less needed.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/8650248287561826610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/8650248287561826610'/><link rel='alternate' type='text/html' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html?showComment=1288360636408#c8650248287561826610' title=''/><author><name>werchter</name><uri>http://werchter.myopenid.com/</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/openid16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html' ref='tag:blogger.com,1999:blog-7106856618803377357.post-2007294977726220559' source='http://www.blogger.com/feeds/7106856618803377357/posts/default/2007294977726220559' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1697353551'/></entry><entry><id>tag:blogger.com,1999:blog-7106856618803377357.post-8389397315022521073</id><published>2010-03-26T15:58:52.894+01:00</published><updated>2010-03-26T15:58:52.894+01:00</updated><title type='text'>THANKS MAN!, had been working on a litle project l...</title><content type='html'>THANKS MAN!, had been working on a litle project like this to make attributeExt, but my brain like poped out :), now this , Good Job!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/8389397315022521073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/8389397315022521073'/><link rel='alternate' type='text/html' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html?showComment=1269615532894#c8389397315022521073' title=''/><author><name>Stevo</name><uri>http://www.blogger.com/profile/08756654131829828013</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html' ref='tag:blogger.com,1999:blog-7106856618803377357.post-2007294977726220559' source='http://www.blogger.com/feeds/7106856618803377357/posts/default/2007294977726220559' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1886890430'/></entry><entry><id>tag:blogger.com,1999:blog-7106856618803377357.post-2841571868875821211</id><published>2008-10-29T08:28:00.000+01:00</published><updated>2008-10-29T08:28:00.000+01:00</updated><title type='text'>You may use this mixin :)&lt;br&gt;&lt;br&gt;        public st...</title><content type='html'>You may use this mixin :)&lt;BR/&gt;&lt;BR/&gt;        public static bool IsAttributeDefined&amp;lt;T&amp;gt;(this ICustomAttributeProvider provider, bool inherit = true)&lt;BR/&gt;            where T : Attribute&lt;BR/&gt;        {&lt;BR/&gt;            return provider.IsDefined(typeof(T), inherit);&lt;BR/&gt;        }&lt;BR/&gt;&lt;BR/&gt;        public static T[] GetAttributes&amp;lt;T&amp;gt;(this ICustomAttributeProvider provider, bool inherit = true)&lt;BR/&gt;            where T : Attribute&lt;BR/&gt;        {&lt;BR/&gt;            return provider.GetCustomAttributes(typeof(T), inherit) as T[];&lt;BR/&gt;        }&lt;BR/&gt;&lt;BR/&gt;        public static T GetFirstAttribute&amp;lt;T&amp;gt;(this ICustomAttributeProvider provider, inherit = true)&lt;BR/&gt;            where T : Attribute&lt;BR/&gt;        {&lt;BR/&gt;            return provider.GetAttributes&amp;lt;T&amp;gt;(inherit).FirstOrDefault();&lt;BR/&gt;        }&lt;BR/&gt;    }&lt;BR/&gt;&lt;BR/&gt;P.S. some C# 4.0 code :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/2841571868875821211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/2841571868875821211'/><link rel='alternate' type='text/html' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html?showComment=1225265280000#c2841571868875821211' title=''/><author><name>AutoRevit</name><uri>http://www.blogger.com/profile/08516474811982634893</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html' ref='tag:blogger.com,1999:blog-7106856618803377357.post-2007294977726220559' source='http://www.blogger.com/feeds/7106856618803377357/posts/default/2007294977726220559' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2116592913'/></entry><entry><id>tag:blogger.com,1999:blog-7106856618803377357.post-6051216334984933718</id><published>2008-10-20T14:16:00.000+02:00</published><updated>2008-10-20T14:16:00.000+02:00</updated><title type='text'>And with that, I believe you've addressed the two ...</title><content type='html'>And with that, I believe you've addressed the two most significant concerns of the subject matter. Thank you!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/6051216334984933718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/6051216334984933718'/><link rel='alternate' type='text/html' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html?showComment=1224504960000#c6051216334984933718' title=''/><author><name>Raudaun</name><uri>http://www.blogger.com/profile/11140775518649795862</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html' ref='tag:blogger.com,1999:blog-7106856618803377357.post-2007294977726220559' source='http://www.blogger.com/feeds/7106856618803377357/posts/default/2007294977726220559' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-264339462'/></entry><entry><id>tag:blogger.com,1999:blog-7106856618803377357.post-873042179237067638</id><published>2008-10-20T08:09:00.000+02:00</published><updated>2008-10-20T08:09:00.000+02:00</updated><title type='text'>Performance of attributes vs. interfaces is very d...</title><content type='html'>Performance of attributes vs. interfaces is very different and attribute comes out losing. In the tests I did, checking attributes were significantly slower than checking interfaces, sometimes up to 1000-2000 times slower!&lt;BR/&gt;&lt;BR/&gt;But don't be too scared. For individual checks we are still speaking about 0.00002 secs. per attribute check, so it is not hurting your performance in any noticeable way as long as you aren't doing several thousand checks per second.&lt;BR/&gt;&lt;BR/&gt;The thing to do is to judge it on a case by case basis and weigh the pros and cons whenever you need to employ a marker interface or attribute. Interfaces may be fast but has less flexibility than attributes.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/873042179237067638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/873042179237067638'/><link rel='alternate' type='text/html' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html?showComment=1224482940000#c873042179237067638' title=''/><author><name>Johannes Hansen</name><uri>http://www.blogger.com/profile/07074118510041869171</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html' ref='tag:blogger.com,1999:blog-7106856618803377357.post-2007294977726220559' source='http://www.blogger.com/feeds/7106856618803377357/posts/default/2007294977726220559' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1717069372'/></entry><entry><id>tag:blogger.com,1999:blog-7106856618803377357.post-4687385613959815755</id><published>2008-10-19T23:34:00.000+02:00</published><updated>2008-10-19T23:34:00.000+02:00</updated><title type='text'>Nice class! Have you considered or tested the perf...</title><content type='html'>Nice class! Have you considered or tested the performance difference of the marker interface check vs checking for attributes using your code?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/4687385613959815755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7106856618803377357/2007294977726220559/comments/default/4687385613959815755'/><link rel='alternate' type='text/html' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html?showComment=1224452040000#c4687385613959815755' title=''/><author><name>Raudaun</name><uri>http://www.blogger.com/profile/11140775518649795862</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.johannesh.dk/2008/08/extension-types-for-easier-and-strongly.html' ref='tag:blogger.com,1999:blog-7106856618803377357.post-2007294977726220559' source='http://www.blogger.com/feeds/7106856618803377357/posts/default/2007294977726220559' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-264339462'/></entry></feed>
