<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Microsoft</title>
        <link>http://ayende.com/Blog/category/480.aspx</link>
        <description>Microsoft</description>
        <language>en-US</language>
        <copyright>Ayende Rahien</copyright>
        <managingEditor>Ayende@ayende.com</managingEditor>
        <generator>Subtext Version 2.0.0.0</generator>
        <item>
            <title>Microsoft Courier</title>
            <link>http://ayende.com/Blog/archive/2009/09/23/microsoft-courier.aspx</link>
            <description>&lt;p&gt;There are some things that I just don’t get. The new &lt;a href="http://www.neowin.net/news/main/09/09/22/microsofts-secret-courier-booklet-device-unveiled"&gt;MS Courier&lt;/a&gt; is one such thing. Check the link, this is basically a book size iPhone/tablet. &lt;/p&gt;  &lt;p&gt;Go checkout the video, you’ll notice something that will &lt;em&gt;kill&lt;/em&gt; this device. &lt;/p&gt;  &lt;p&gt;It uses a pen, to write!&lt;/p&gt;  &lt;p&gt;Leaving aside the fact that no OCR program has yet been able to figure out what I am writing (including the one in my brain), using a pen it annoying. &lt;/p&gt;  &lt;p&gt;I write about three to four times as fast using a keyboard than using a pen (and I can use both hands). And I don’t &lt;em&gt;write&lt;/em&gt;, using archaic pen &amp;amp; paper, much at all. That affect my writing readability when I &lt;em&gt;am&lt;/em&gt; using a pen, of course, leading to a feedback cycle.&lt;/p&gt;  &lt;p&gt;This pretty much turn me off of the device completely.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/11139.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/09/23/microsoft-courier.aspx</guid>
            <pubDate>Wed, 23 Sep 2009 07:35:39 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/09/23/microsoft-courier.aspx#feedback</comments>
            <slash:comments>18</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/11139.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Hello!!! Is this ON?! [Connect Bugs sucks, again]</title>
            <link>http://ayende.com/Blog/archive/2009/09/12/hello-is-this-on-connect-bugs-sucks-again.aspx</link>
            <description>&lt;p&gt;I want to point you to &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=384781"&gt;this bug&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/HelloIsthisONConnectBugssucksagain_116C1/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/HelloIsthisONConnectBugssucksagain_116C1/image_thumb.png" width="561" height="264" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Do you &lt;strong&gt;see&lt;/strong&gt; the Won’t Fix there?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/HelloIsthisONConnectBugssucksagain_116C1/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/HelloIsthisONConnectBugssucksagain_116C1/image_thumb_1.png" width="538" height="130" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Let us take a look at what ExecutionEngineException is all about, okay?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/HelloIsthisONConnectBugssucksagain_116C1/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/HelloIsthisONConnectBugssucksagain_116C1/image_thumb_2.png" width="382" height="42" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now, the real problem here is that along with this issue there is a &lt;em&gt;failing sample&lt;/em&gt;, so it is not a case of not being able to reproduce the error. Granted, the customer has managed to find a workaround for their problem, but the bug in the framework is still there, and was &lt;em&gt;not&lt;/em&gt; fixed. I would assume that CLR crashing bugs that “should never occur” would be given &lt;em&gt;some&lt;/em&gt; priority, even if the customer managed to find a workaround.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/11116.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/09/12/hello-is-this-on-connect-bugs-sucks-again.aspx</guid>
            <pubDate>Sat, 12 Sep 2009 16:50:12 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/09/12/hello-is-this-on-connect-bugs-sucks-again.aspx#feedback</comments>
            <slash:comments>15</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/11116.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Why Defer Loading in Entity Framework isn&amp;rsquo;t going to work</title>
            <link>http://ayende.com/Blog/archive/2009/05/29/why-defer-loading-in-entity-framework-isnrsquot-going-to-work.aspx</link>
            <description>&lt;p&gt;When I finished reading &lt;a href="http://blogs.msdn.com/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx"&gt;this post&lt;/a&gt; I let out a heavy sigh. It is not going to work. Basically, the EF is going the same way that NHibernate was in NHibernate 1.0 (circa 2005!).&lt;/p&gt;  &lt;p&gt;Let me show you how. in the post, the example given is:&lt;/p&gt;  &lt;blockquote&gt;   &lt;div&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Category
{
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; CategoryID { get; set; }
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; CategoryName { get; set; }
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt; List&amp;lt;Product&amp;gt; Products { get; set; }
    ...
}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;This looks like it would work, right? The way the EF is doing this is by creating a proxy of your class (similar to the way that NHibernate is doing that) and intercepting the call to get_Products.&lt;/p&gt;

&lt;p&gt;It has a few problems, however. Let us start from the most obvious one, program to &lt;em&gt;interface&lt;/em&gt; not to &lt;em&gt;implementation.&lt;/em&gt; Exposing List&amp;lt;T&amp;gt; means that you have no control whatsoever about what is going on with the collection. It also means that they have to intercept the access to the property, not using the collection. That is &lt;em&gt;bad&lt;/em&gt;, it means that they are going to have to do eager loading in all too many cases where NHibernate can just ignore it.&lt;/p&gt;

&lt;p&gt;Let us more on a bit, and talk about the inability to support any interesting scenario. If we look at collections with NHibernate, we can take this:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;div&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;Console.WriteLine(category.Products.Count);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;To this SQL:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;div&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;select&lt;/span&gt; &lt;span style="color: #0000ff"&gt;count&lt;/span&gt;(*) &lt;span style="color: #0000ff"&gt;from&lt;/span&gt; Products
&lt;span style="color: #0000ff"&gt;where&lt;/span&gt; CategoryId = 1&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;With the approach that the EF uses, they will have to load the entire collection.&lt;/p&gt;

&lt;p&gt;But all of those are just optimizations, not the make-or-break for the feature. Here is a common scenario that is going to break it:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;div&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Category
{
    &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; List&amp;lt;Product&amp;gt; _products;
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; CategoryID { get; set; }
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; CategoryName { get; set; }
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;virtual&lt;/span&gt; List&amp;lt;Product&amp;gt; Products { get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; _products; } set { _products = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;; } }

    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; AddProduct(Product p)
    {
        &lt;span style="color: #008000"&gt;// do something interesting here&lt;/span&gt;
        _products.Add(p);
    }
    ...
}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;There is a &lt;em&gt;reason&lt;/em&gt; why the default proxies for NHibernate force all members of the entities to be virtual. It is not just because we think everything should be virtual (it should, but that is not a discussion for now). It is all about being able to allow the user to use a real POCO.&lt;/p&gt;

&lt;p&gt;In the scenario outlined above, what do you think is going to happen? &lt;/p&gt;

&lt;p&gt;AddProduct is a non virtual method call, so it cannot be intercepted. Accessing the _products field also cannot be intercepted. &lt;/p&gt;

&lt;p&gt;The end result is a NullReferenceException that will seem to appear randomly, based on whatever something else touched the Property or not. And however nice auto properties are, there are plenty of reason to use fields. Using auto properties just mask the problem, but it is still there.&lt;/p&gt;

&lt;p&gt;Oh, and if we want to use our POCO class with EF, forget about the new operator, you have to use:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;div&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;Category category = context.CreateObject&amp;lt;Category&amp;gt;();&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hm, this just breaks just about &lt;em&gt;anything&lt;/em&gt; that relies on creating new classes. Want to use your entity as parameter for ASP.Net MVC action, to be automatically bounded? Forget about it. You have to create your instances where you have access to the context, and that is a database specific thing, not something that you want to have all over the place.&lt;/p&gt;

&lt;p&gt;And I really liked this as well:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The standard POCO entities we have talked about until now rely on snapshot based change tracking – i.e. the Entity Framework will maintain snapshots of before values and relationships of the entities so that they can be compared with current values later during Save. However, this comparison is relatively expensive when compared to the way change tracking works with EntityObject based entities.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hm, this is how NHibernate and Hibernate have &lt;em&gt;always&lt;/em&gt; worked. Somehow, I don’t see this showing up as a problem very often. &lt;/p&gt;

&lt;p&gt;Final thought, why is the EF calling it Defer Loading? Everyone else call it lazy loading.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10959.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/05/29/why-defer-loading-in-entity-framework-isnrsquot-going-to-work.aspx</guid>
            <pubDate>Fri, 29 May 2009 00:04:41 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/05/29/why-defer-loading-in-entity-framework-isnrsquot-going-to-work.aspx#feedback</comments>
            <slash:comments>59</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10959.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How Microsoft should release guidance?</title>
            <link>http://ayende.com/Blog/archive/2009/04/18/how-microsoft-should-release-guidance.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://haacked.com/"&gt;Phil Haack&lt;/a&gt; has a post about &lt;a href="http://haacked.com/archive/2009/04/16/code-sample-taxonomy.aspx"&gt;code sample taxonomy&lt;/a&gt;, in which he asks how Microsoft can ship high quality sample apps:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Obviously, this [shipping high quality samples] is what we should be striving for, but what do we do in the meantime? Stop shipping samples? I hope not.&lt;/p&gt;    &lt;p&gt;Again, I don’t claim to have the answers, but I think there are a few things that could help. One &lt;a href="http://twitter.com/serialseb/status/1537092090"&gt;twitter response&lt;/a&gt; made a great point:&lt;/p&gt;    &lt;blockquote&gt;     &lt;p&gt;a reference app is going to be grilled. Even more if it comes from the mothership. &lt;strong&gt;Get the community involved&lt;/strong&gt; *before* it gets pub&lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;Getting the community involved is a great means of having your code reviewed to make sure you’re not doing anything obviously stupid. Of course, even in this, there’s a challenge. Jeremy Miller made &lt;a href="http://codebetter.com/blogs/jeremy.miller/archive/2009/04/07/talking-alt-net-with-james-avery.aspx"&gt;this great point recently&lt;/a&gt;:&lt;/p&gt;    &lt;blockquote&gt;     &lt;p&gt;We don't have our own story straight yet.  We're still advancing our craft.  By no means have we reached some sort of omega point in our own development efforts.  &lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;In other words, even with community involvement, you’re probably going to piss someone off.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Um, no.&lt;/p&gt;  &lt;p&gt;I feel that Jeremy’s point has been pulled out of context. While we may have disagreements about what constitute the future directions in software development, that isn’t actually what cause the community to reject the bad samples from Microsoft.&lt;/p&gt;  &lt;p&gt;No one said a word about Kobe because it didn’t use NHibernate, or wasn’t built with messaging or using DDD.&lt;/p&gt;  &lt;p&gt;What we reject in those sample app is that they are, put simply, bad coding. There is nothing amorphous about this, we aren’t talking about subjective feeling, we are talking about very concrete, objective and real metrics that we can apply.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Bad Code&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Not some omega point.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Bad Code&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Not lack of understanding of the platform because the developers writing that were new to ASP.Net MVC.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Bad Code&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;That would have been bad code if it was written 5 years ago or 15 years ago.&lt;/p&gt;  &lt;p&gt;That is the problem.&lt;/p&gt;  &lt;p&gt;And I think that there is quite a simple answer for that. Stop shipping official guidance package without involvement from the community.&lt;/p&gt;  &lt;p&gt;Create a special CodePlex project where you are being explicit about putting things &lt;em&gt;for review&lt;/em&gt;, not for publishing. After the guidance has been published, it is probably too late already. &lt;/p&gt;  &lt;p&gt;Get some feedback from the community, &lt;em&gt;then&lt;/em&gt; you can publish this in the usual places.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10876.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/04/18/how-microsoft-should-release-guidance.aspx</guid>
            <pubDate>Sat, 18 Apr 2009 13:50:00 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/04/18/how-microsoft-should-release-guidance.aspx#feedback</comments>
            <slash:comments>9</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10876.aspx</wfw:commentRss>
        </item>
        <item>
            <title>What do I expect from guidance?</title>
            <link>http://ayende.com/Blog/archive/2009/04/17/what-do-i-expect-from-guidance.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://haacked.com/"&gt;Phil Haack&lt;/a&gt; has a post about &lt;a href="http://haacked.com/archive/2009/04/16/code-sample-taxonomy.aspx"&gt;code sample taxonomy&lt;/a&gt;. He suggests the following taxonomy:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Prototype&lt;/li&gt;    &lt;li&gt;Demo&lt;/li&gt;    &lt;li&gt;Sample&lt;/li&gt;    &lt;li&gt;Production&lt;/li&gt;    &lt;li&gt;Reference&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I am not sure that I agree with his division. From my point of view, demo code need to focus on one single aspect, mostly because we are going to talk around that, and doing that means that I don’t have the time to deal with anything but the aspect that I need to talk about.&lt;/p&gt;  &lt;p&gt;Sample code is a more fleshed out example. &lt;/p&gt;  &lt;p&gt;I don’t make any distinction between reference and sample apps, maybe the size is different but that is about it.&lt;/p&gt;  &lt;p&gt;What is important to follow is that for all of them, except maybe prototype (and I was bitten by that before), I have the &lt;em&gt;same&lt;/em&gt; code quality expectations.&lt;/p&gt;  &lt;p&gt;Note that I am saying &lt;em&gt;code quality&lt;/em&gt; vs. &lt;em&gt;production readiness&lt;/em&gt;. Most of the code that you see in demos or sample apps is &lt;em&gt;not&lt;/em&gt; production ready. And that is &lt;em&gt;fine&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;Production readiness include such things as:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Parameter validation&lt;/li&gt;    &lt;li&gt;Security&lt;/li&gt;    &lt;li&gt;Error handling&lt;/li&gt;    &lt;li&gt;Failover &amp;amp; recovery&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;And a lot more “taxes” that we need to deal with.&lt;/p&gt;  &lt;p&gt;That does &lt;em&gt;not&lt;/em&gt; include code quality. Code quality is a metric of its own, and it is one that you &lt;em&gt;cannot &lt;/em&gt;give up. I would be personally ashamed to put out something that didn’t meet my own code quality metrics. &lt;/p&gt;  &lt;p&gt;Sometimes, being production ready means that you have to give up on code quality, &lt;a href="http://ayende.com/Blog/archive/2009/04/01/1st-april-post-ndash-sending-data.aspx"&gt;here is one example&lt;/a&gt;, that is understood and acceptable in certain circumstances.&lt;/p&gt;  &lt;p&gt;What is &lt;em&gt;not&lt;/em&gt; acceptable is to say that this is “Xyz” type of code sample, therefore code quality doesn’t matter.&lt;/p&gt;  &lt;p&gt;And code quality isn’t really some amorphous thing. It is a very well defined metric that can be automatically checked. FxCop or NDepend are good tools to have, Simian will give you a lot of value all on its own. &lt;/p&gt;  &lt;p&gt;When you put something out as an official Microsoft guidance release, the bar is higher, because whatever you do &lt;em&gt;will&lt;/em&gt; be used by other people.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10875.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/04/17/what-do-i-expect-from-guidance.aspx</guid>
            <pubDate>Fri, 17 Apr 2009 13:53:05 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/04/17/what-do-i-expect-from-guidance.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10875.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Microsoft Connect - FAIL (yet again)</title>
            <link>http://ayende.com/Blog/archive/2009/03/24/microsoft-connect-fail-yet-again.aspx</link>
            <description>&lt;p&gt;I really think that Microsoft should close Connect. Because it is pretty obvious that they aren't managing that properly.&lt;/p&gt;
&lt;p&gt;Let us take a look at yet another &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=294197"&gt;interesting bug report&lt;/a&gt;. This is related to a bug in System.Data that makes using System.Transactions even trickier than you would initially believe.&lt;/p&gt;
&lt;p&gt;It was &lt;em&gt;acknowledged&lt;/em&gt; as a bug by &lt;a href="http://blogs.msdn.com/miguel/"&gt;Miguel Gasca&lt;/a&gt; (from Microsoft), and a connect was reported.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;That&lt;/em&gt; was in 2007(!), it was &lt;strong&gt;resolved&lt;/strong&gt;, a month later, by "Microsoft", because it is "External" issue.&lt;/p&gt;
&lt;p&gt;That bug is till here today, two years later, and still impacting customers. That is &lt;em&gt;after&lt;/em&gt; a full release &lt;em&gt;and&lt;/em&gt; SP1. The situation is that now I have to work around this bug because Microsoft cannot manage its own bugs database in a way that would allow it to... oh, I don't know, fix bugs!&lt;/p&gt;
&lt;p&gt;FAIL&lt;/p&gt;
&lt;p&gt;And you know what, I &lt;em&gt;wouldn't&lt;/em&gt; be annoyed with this if this wasn't an ongoing pattern with Connect.&lt;/p&gt;
&lt;p&gt;FAIL&lt;/p&gt;
&lt;img src="http://ayende.com/Blog/aggbug/10835.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/03/24/microsoft-connect-fail-yet-again.aspx</guid>
            <pubDate>Tue, 24 Mar 2009 10:18:37 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/03/24/microsoft-connect-fail-yet-again.aspx#feedback</comments>
            <slash:comments>11</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10835.aspx</wfw:commentRss>
        </item>
        <item>
            <title>MEF &amp; Open Generic Types </title>
            <link>http://ayende.com/Blog/archive/2009/03/22/mef-open-generic-types.aspx</link>
            <description>&lt;p&gt;I read &lt;a href="http://codebetter.com/blogs/glenn.block/archive/2009/03/21/why-doesn-t-mef-support-open-generics-for-exports-because-mef-is-not-type-based.aspx"&gt;Glenn' s post&lt;/a&gt; about MEF's &lt;a href="http://codebetter.com/blogs/glenn.block/archive/2009/03/21/why-doesn-t-mef-support-open-generics-for-exports-because-mef-is-not-type-based.aspx"&gt;not supporting open generic types&lt;/a&gt; with somewhat resembling shock. The idea that it isn't supporting this never even crossed my mind, it was a given that this is a mandatory feature for any container in the .NET land.&lt;/p&gt;
&lt;p&gt;Just to give you an idea, what this means is that you can't register Repository&amp;lt;T&amp;gt; and then resolve Repository&amp;lt;Order&amp;gt;. In 2006, I wrote an &lt;a href="http://msdn.microsoft.com/en-us/library/aa973811.aspx"&gt;article for MSDN&lt;/a&gt; detailing what has since became a very common use of this pattern. Generic specialization is not something that I would consider optional, it is one of the most common usage patterns of containers in the .NET land. IRepository&amp;lt;T&amp;gt; is probably the most common example that people quote, but there &lt;a href="http://ayende.com/Blog/archive/2007/10/21/The-IoC-mind-set-Validation.aspx"&gt;are others as well&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is not a simple feature, let me make it clear. Not simple at all. I should know, I implement that feature for both Object Builder and Windsor. But that is not what I would consider an optional one.&lt;/p&gt;
&lt;p&gt;I am even more disturbed by the actual reasoning behind not supporting this. It is a technical limitation of MEF because internally all components are resolved by string matching, rather than CLR Types. This decision is &lt;em&gt;severely&lt;/em&gt; limiting the things that MEF can do. Not supporting what is (in my opinion) is a pretty crucial feature is one example of that, but there are other implications. It means that you can't really do things like polymorphic resolutions, that your choices in extending the container are very limited, because the container isn't going to carry the information that is required to make those decision.&lt;/p&gt;
&lt;p&gt;I would advice the MEF team to rethink the decision to base the component resolution on strings. At this point in time, it is still possible to change things ( and yes, I &lt;em&gt;know&lt;/em&gt; it isn't as easy as I make it seems ), because not supporting open generic types is bad, but not having the &lt;em&gt;ability&lt;/em&gt; to do so, and the reason for that (not keeping CLR Type information) are even worse. I get that MEF needs to work with DLR objects as well, but that means that MEF makes the decision to have lousier support for CLR idioms for the benefit of the DLR.&lt;/p&gt;
&lt;p&gt;Considering the usage numbers for both of them, I can't see this being a good decision. It is certainly possible to support them both, but if there are any tradeoffs that have to be made, I would suggest that it should be the DLR, and not the CLR, which would be the second class role.&lt;/p&gt;
&lt;img src="http://ayende.com/Blog/aggbug/10829.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/03/22/mef-open-generic-types.aspx</guid>
            <pubDate>Sun, 22 Mar 2009 17:00:00 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/03/22/mef-open-generic-types.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10829.aspx</wfw:commentRss>
        </item>
        <item>
            <title>And now what?</title>
            <link>http://ayende.com/Blog/archive/2009/01/27/and-now-what.aspx</link>
            <description>&lt;p&gt;It looks like the entire MSMQ .NET stack is &lt;em&gt;riddled&lt;/em&gt; with threading bugs. At least if you think about using the async methods such as BeginPeek.&lt;/p&gt;  &lt;p&gt;Nasty!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/Andnowwhat_85FD/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="134" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/Andnowwhat_85FD/image_thumb.png" width="494" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10746.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/01/27/and-now-what.aspx</guid>
            <pubDate>Tue, 27 Jan 2009 17:31:44 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/01/27/and-now-what.aspx#feedback</comments>
            <slash:comments>13</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10746.aspx</wfw:commentRss>
        </item>
        <item>
            <title>MessageQueue trouble continues</title>
            <link>http://ayende.com/Blog/archive/2009/01/25/messagequeue-trouble-continues.aspx</link>
            <description>&lt;p&gt;I mentioned that I got into some problems with MSMQ that I couldn’t reproduce later on. Well, here is the actual code that I am running that is causing a hung. As you can see, this is &lt;em&gt;really &lt;/em&gt;strange.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/MessageQueuetroublecontinues_D770/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="668" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/MessageQueuetroublecontinues_D770/image_thumb.png" width="888" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10743.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/01/25/messagequeue-trouble-continues.aspx</guid>
            <pubDate>Sat, 24 Jan 2009 23:19:30 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/01/25/messagequeue-trouble-continues.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10743.aspx</wfw:commentRss>
        </item>
        <item>
            <title>More information of GC issue</title>
            <link>http://ayende.com/Blog/archive/2009/01/22/more-information-of-gc-issue.aspx</link>
            <description>&lt;p&gt;After a lot more study, it looks like there are two separate issues that are causing the problem here. &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;During AppDomain unload, it is permissible for the GC to collect reachable objects. I am fine with that and I certainly agree that this makes sense.&lt;/li&gt;    &lt;li&gt;Application_End occurs &lt;em&gt;concurrently &lt;/em&gt;with the AppDomain unload.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Looking at the &lt;a href="http://msdn.microsoft.com/en-us/library/ms178473.aspx"&gt;docs&lt;/a&gt; (and there are surprisingly few about this), it seems like 1 is expected, but 2 is a bug. The docs state:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Application_End  - Called once per lifetime of the application before the application is unloaded. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It may be my English, but to me before doesn’t suggest at the same time as.&lt;/p&gt;  &lt;p&gt;So I do believe it is a bug in the framework, but not in the GC, it is in the shutdown code for ASP.Net. This is still a &lt;em&gt;very&lt;/em&gt; nasty problem.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10736.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/01/22/more-information-of-gc-issue.aspx</guid>
            <pubDate>Thu, 22 Jan 2009 15:27:54 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/01/22/more-information-of-gc-issue.aspx#feedback</comments>
            <slash:comments>14</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10736.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>