<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>re:motion Team Blog</title>
        <link>http://re-motion.org/blogs/team/Default.aspx</link>
        <description />
        <language>en-US</language>
        <copyright>re:motion Team</copyright>
        <managingEditor>TeamBlogAlerts@rubicon.eu</managingEditor>
        <generator>Subtext Version 1.9.5.177</generator>
        <image>
            <title>re:motion Team Blog</title>
            <url>http://re-motion.org/blogs/images/RSS2Image.gif</url>
            <link>http://re-motion.org/blogs/team/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>.NET 3.5 SP1 service release coming!</title>
            <link>http://re-motion.org/blogs/team/archive/2008/09/24/.net-3.5-sp1-service-release-coming.aspx</link>
            <description>&lt;p&gt;It seems that sometimes whining helps. After &lt;a href="http://www.re-motion.org/blogs/team/archive/2008/08/14/.net-3.5-sp1-broke-some-scenarios-for-mixins.aspx"&gt;complaining&lt;/a&gt; long enough about how the bugs in SP1 affect us and our customers, Microsoft decided to fix the two bugs that bother us. Better yet, those hotfixes (and some others I would guess) will be rolled up in a servicing release for SP1, which will be distributed via Windows Update as soon as SP1 itself gets fixed.&lt;/p&gt;  &lt;p&gt;The following has been posted by MS for &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361606"&gt;both&lt;/a&gt; &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361615"&gt;bugs&lt;/a&gt; yesterday:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;We're also in the process of testing a hotfix for this issue. I expect it will be available within a week or so. I'll keep you posted on the status and give you the KB (knowledge base) article number and how you, and other customers, can acquire the hotfix once it's available.      &lt;br /&gt;Additionally we intend to include this fix in an upcoming servicing release, a roll-up of sorts, which will be released in synch with 3.5SP1 via Windows Update. I.e. when 3.5SP1 starts getting pushed out broadly, so will this fix. We’re still working out the exact timeframe for this release but our hope is before the end of the year.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Thanks to &lt;a href="http://ayende.com/Blog/"&gt;Ayende Rahien&lt;/a&gt;, who helped me make that case with some numbers off affected projects and users, and &lt;a href="http://blogs.msdn.com/charlie/"&gt;Charlie Calvert&lt;/a&gt; of Microsoft who carried our feedback to their management, who eventually decided to do the right thing. It's good to know that when stuff like that happens, these guys are willing to do what it takes so this won't hit us too hard.&lt;/p&gt;  &lt;p&gt;For other people who have to deal with SP1 regression problems in similar situations, I would think that now might be a good time to try and get them to include your favorite bug in this roll-up. Providing some background about your particular situation seems to help.&lt;/p&gt;  &lt;p&gt;Update: Just found out that Scott Hanselman already &lt;a href="http://www.hanselman.com/blog/UpdateOnNETFramework35SP1AndWindowsUpdate.aspx"&gt;blogged&lt;/a&gt; about this with much more detail.&lt;/p&gt;&lt;img src="http://re-motion.org/blogs/team/aggbug/14.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>re:motion Team</dc:creator>
            <guid>http://re-motion.org/blogs/team/archive/2008/09/24/.net-3.5-sp1-service-release-coming.aspx</guid>
            <pubDate>Wed, 24 Sep 2008 08:50:30 GMT</pubDate>
            <wfw:comment>http://re-motion.org/blogs/team/comments/14.aspx</wfw:comment>
            <comments>http://re-motion.org/blogs/team/archive/2008/09/24/.net-3.5-sp1-service-release-coming.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://re-motion.org/blogs/team/comments/commentRss/14.aspx</wfw:commentRss>
        </item>
        <item>
            <title>.NET 3.5 SP1 broke some scenarios for mixins</title>
            <category>lang.net</category>
            <category>mixins</category>
            <link>http://re-motion.org/blogs/team/archive/2008/08/14/.net-3.5-sp1-broke-some-scenarios-for-mixins.aspx</link>
            <description>&lt;p align="justify"&gt;OK, first, apologies for not posting for so long. The initial post was triggered by the Lang.NET symposium. We thought it might be a good idea to come forward with a part of our framework even prematurely, because Lang.NET might trigger enough interest. Seems that this did not happen, and since comments were rare, we decided to continue working on some refactorings, extensions and documentation we wanted to get ready before the real launch. Good news: We're almost there. &lt;/p&gt;  &lt;h3 align="justify"&gt;SP1 bug for custom modifiers&lt;/h3&gt;  &lt;p align="justify"&gt;The service pack that was released yesterday crashes when certain APIs for custom modifiers are called on generic methods of generic interfaces, like IWhatever&amp;lt;T&amp;gt;.Foo&amp;lt;U&amp;gt;(). &lt;/p&gt;  &lt;p align="justify"&gt;Fabian posted a &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361606"&gt;connect bug&lt;/a&gt; with details, votes are welcome. &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://ayende.com/Blog/"&gt;Ayende Rahien&lt;/a&gt; has the exact &lt;a href="http://ayende.com/Blog/archive/2008/08/13/How-.Net-3.5-SP1-broke-Rhino-Mocks.aspx"&gt;same problem&lt;/a&gt; with RhinoMocks. Just like Ayende, a non-redistributable hotfix does not seem like much of a solution to us. Even a redistributable one would make the install experience quite cumbersome. I have no doubt that this would be fixed in the next release, but that'd take some time. A hotfix that gets distributed via Windows/Microsoft Update would be great, of course.&lt;/p&gt;  &lt;p align="justify"&gt;No idea what Microsoft can or will do for us here. However, unlike Ayende, we have no problem with using PSS, the risk of getting charged is not really a problem. But first, let's give them a few days time to handle this via connect.&lt;/p&gt;  &lt;p align="justify"&gt;Here are our options:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Find another way to get custom modifiers. That would be great, but it's quite unlikely that another .NET API, if it exists, would not result in the same situation within the CLR.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Use &lt;a href="http://www.mono-project.com/Cecil"&gt;Cecil&lt;/a&gt; instead of Reflection. There are a few things we'd like to use Cecil for in the future, but this is not something that we're going to do tomorrow.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Do nothing and have the users worry about any ExecutionEngineExceptions they might get. (This exception will happily escape any catch block.) No way.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Disable mixins for this scenario (generic methods of generic interfaces)&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Not support languages that depend on custom modifiers, like C++/CLI and, according to Ayende, also F# and Spec#&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Disable custom modifiers by default, so that users of those languages will have to actively enable it in the configuration, and also take full responsibility for making sure they're using a .NET release that will not crash.&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;We're very likely to go for the last option. We might do that in the Castle project, where Fabian is a commiter (the code that actually triggers this bug is in a &lt;a href="http://www.castleproject.org/dynamicproxy/"&gt;DynamicProxy&lt;/a&gt; method we're using), someone else might do it before us, or we could re-implement that DynamicProxy method in our own code, if no agreement can be found among Castle developers.&lt;/p&gt;  &lt;p align="justify"&gt;Opinions are welcome.&lt;/p&gt;  &lt;ul&gt;   &lt;p align="justify"&gt;&lt;/p&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;&lt;/p&gt;  &lt;h3 align="justify"&gt;SP1 serialization bug &lt;/h3&gt;  &lt;p align="justify"&gt;Here's another &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361615"&gt;connect bug&lt;/a&gt;: Be careful with static members of ISerializable types. (Be sure to read Höcke's comment on the &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/Validation.aspx?FeedbackID=361615"&gt;validation page&lt;/a&gt;, this seems to be worse than it appeared)&lt;/p&gt;  &lt;p align="justify"&gt;This only broke some unit test, and we were able to work around it. Still, I find it remarkable that a Service Pack would introduce two regression bugs that break our code. Then again, we're doing some weird stuff, especially in the mixin part, and Fabian really went out of his way to make sure he gets unit test coverage for a wide range of usage scenarios.&lt;/p&gt;  &lt;p align="justify"&gt;(Like, we crashed Mono at Lang.NET with a unit test that tested whether deliberately broken user code would trigger the correct CLR Exception. But I guess it's part of the magic of an event like that when &lt;a href="http://mareksafar.blogspot.com/"&gt;Marek Safar&lt;/a&gt; (the Mono C# guy) analyzes this "bug", &lt;a href="http://fepy.blogspot.com/"&gt;Seo Sanghyeon&lt;/a&gt; fixes it within minutes, and &lt;a href="http://tirania.org/blog/"&gt;Miguel de Icaza&lt;/a&gt; triages it for backporting to the Mono release that was branched off the day before. Cool stuff.)&lt;/p&gt;  &lt;p align="justify"&gt;We've already discovered quite a few bugs in the past, many of them really low level CLR stuff. (We once even reported a security vulnerability in the CLR, I'll have to go check what happened to that one. No credits yet.)&lt;/p&gt;  &lt;p align="justify"&gt;But discovering bugs during implementation is one thing. The ratio of bugs that get fixed for the next release is quite OK. Discovering regressions is another story, this breaks code that already worked, or is being used in production, and the ripple effects of such bugs, especially in the CLR itself, can be quite horrible. &lt;/p&gt;  &lt;p align="justify"&gt;All this makes me wonder if Microsoft should not want to include our test suite in their build process. Hell, we'd even give it away without source code so they don't get blinded by LGPL'ed code! ;-)&lt;/p&gt;  &lt;p align="justify"&gt;- Stefan&lt;/p&gt;&lt;img src="http://re-motion.org/blogs/team/aggbug/13.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>re:motion Team</dc:creator>
            <guid>http://re-motion.org/blogs/team/archive/2008/08/14/.net-3.5-sp1-broke-some-scenarios-for-mixins.aspx</guid>
            <pubDate>Thu, 14 Aug 2008 09:09:17 GMT</pubDate>
            <wfw:comment>http://re-motion.org/blogs/team/comments/13.aspx</wfw:comment>
            <comments>http://re-motion.org/blogs/team/archive/2008/08/14/.net-3.5-sp1-broke-some-scenarios-for-mixins.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://re-motion.org/blogs/team/comments/commentRss/13.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Announcing re:motion mixins at lang.net 2008</title>
            <category>lang.net</category>
            <category>mixins</category>
            <link>http://re-motion.org/blogs/team/archive/2008/01/28/announcing-remotion-mixins-at-lang.net-2008.aspx</link>
            <description>&lt;p&gt;Hi there, I'm Stefan Wenig, from &lt;a href="http://www.rubicon.eu"&gt;rubicon informations­technologie&lt;/a&gt; in Vienna, Austria. My coworker Fabian Schmied and I just arrived in Redmond for &lt;a href="http://langnetsymposium.com"&gt;lang.net 2008&lt;/a&gt;. We'll be introducing a new mixin mechanism for C# on Tuesday, and we're going to provide some coverage of mixins here. If time allows, we might also blog a bit about other interesting stuff from lang.net, of which there should be plenty.&lt;/p&gt;
&lt;p&gt;re:motion is a framework for .NET enterprise applications that we've been developing at rubicon for some years now. The mixin mechanism is just one of the libraries it contains, and we're in the process of moving it all to a OSS development model. If that sounds interesting to you (it should, I promise!), you'll soon find more information on this blog and on the &lt;a href="http://www.re-motion.org"&gt;home&lt;/a&gt; page.&lt;/p&gt;
&lt;p&gt;This has to be enough for now. Our attendence at lang.net has been on pretty short notice, we left Vienna 22 hrs ago. I'm going to sleep, and tomorrow we'll have to, guess what, finish our presentation. &lt;/p&gt;
&lt;p&gt;The next week will see more blogging about re:motion.&lt;/p&gt;
&lt;p&gt;- Stefan&lt;/p&gt;&lt;img src="http://re-motion.org/blogs/team/aggbug/3.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>re:motion Team</dc:creator>
            <guid>http://re-motion.org/blogs/team/archive/2008/01/28/announcing-remotion-mixins-at-lang.net-2008.aspx</guid>
            <pubDate>Mon, 28 Jan 2008 08:16:46 GMT</pubDate>
            <wfw:comment>http://re-motion.org/blogs/team/comments/3.aspx</wfw:comment>
            <comments>http://re-motion.org/blogs/team/archive/2008/01/28/announcing-remotion-mixins-at-lang.net-2008.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://re-motion.org/blogs/team/comments/commentRss/3.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Lang.NET talk video available</title>
            <category>lang.net</category>
            <category>mixins</category>
            <link>http://re-motion.org/blogs/team/archive/2008/02/20/lang.net-talk-video-available.aspx</link>
            <description>&lt;p&gt;Hi there as well! I'm Fabian Schmied, also from &lt;a href="http://www.rubicon.eu"&gt;rubicon&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Today, Microsoft has published the video of the talk Stefan and I gave at the &lt;a href="http://langnetsymposium.com"&gt;Lang.NET symposium 2008&lt;/a&gt;, you can find it &lt;a href="http://langnetsymposium.com/talks/2-10%20-%20remotion%20Mixins%20-%20Stefan%20Wenig%20and%20Fabian%20Schmied%20-%20rubicon.html"&gt;here&lt;/a&gt;. In the talk, Stefan explains our original motivation for creating re:motion mixins, our mixin library. I give a technical overview about the library (including a very short demo).&lt;/p&gt;
&lt;p&gt;This is just the first post providing some insight about re:motion (especially re:motion mixins), though only indirectly. We'll give more details, explanations, and samples in the near future. In the meantime, feel free to ask specific questions by posting comments to this blog.&lt;/p&gt;
&lt;p&gt;- Fabian&lt;/p&gt;&lt;img src="http://re-motion.org/blogs/team/aggbug/10.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://re-motion.org/blogs/team/archive/2008/02/20/lang.net-talk-video-available.aspx</guid>
            <pubDate>Wed, 20 Feb 2008 13:14:22 GMT</pubDate>
            <wfw:comment>http://re-motion.org/blogs/team/comments/10.aspx</wfw:comment>
            <comments>http://re-motion.org/blogs/team/archive/2008/02/20/lang.net-talk-video-available.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://re-motion.org/blogs/team/comments/commentRss/10.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Introducing mixins (finally)</title>
            <category>mixins</category>
            <link>http://re-motion.org/blogs/team/archive/2008/02/20/introducing-mixins-finally.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;Sorry for the delay. After lang.net I spent some time having fun with a bronchitis I caught there (I blame winter-season air conditioning). You can hear it in the talk too, but anyway, here we go.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;In the last few months, we have developed a mixin mechanism for static .NET languages, which we're using with C#. After a few months of internal dogfooding, we're now ready to release it under an OSS license.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;We believe that it provides several useful mechanisms for C# 2.0 and above today. Our mechanism is both powerful and easy to use, syntactically and semantically. We're using it internally both for typical development problems that would traditionally require duplicate code in C#, as well as for componentized product line development.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Here's a simple example:&lt;/font&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;[Uses (&lt;span class="kwrd"&gt;typeof&lt;/span&gt; (MyMixin))]
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Target
{
}

&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MyMixin: IMyMixin
{
}

Target t = ObjectFactory.NewObject&amp;lt;Target&amp;gt;().With(); &lt;span class="rem"&gt;// With provides the constructor arguments &lt;/span&gt;
IMyMixin m = (IMyMixin) t; &lt;/pre&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt;&lt;font face="Arial"&gt;All instances of the target type now implement the IMyMixin interface (as long as they are created via ObjectFactory). &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The trick here is that mixins are in reality a composition mechanism, but implementing mixins feels more like inheritance. You define a mixin much like a subclass, and when you use the factory, a subclass is created that does all the composition for you. That gives you most of the power of multiple inheritance (and then some) without its specific problems, like diamond inheritance.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;If the target type implements an interface, you can skip the casting by deriving what we call a "complete interface". (Remember that whatever you might have heard about multiple inheritance, it's generally assumed to be safe for interfaces.)&lt;/font&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; ICompleteTarget: ITarget, IMixin {}
ICompleteTarget t = ObjectFactory.NewObject&amp;lt;ICompleteTarget&amp;gt;().With(); &lt;/pre&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt;&lt;font face="Arial"&gt;This is a general property of re:motion mixins: Everything works a bit smoother if you're using interfaces a lot, but you can always work around it if that is not the case.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Here's an advanced (if somewhat contrived) example:&lt;/font&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Target: ITarget
{
  &lt;span class="kwrd"&gt;public&lt;/span&gt; Target (&lt;span class="kwrd"&gt;string&lt;/span&gt; name) {...}
  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;virtual&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetSomething() {...} 
} 

&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IMixin
{
  &lt;span class="kwrd"&gt;void&lt;/span&gt; ResetCache();
}

[Extends (&lt;span class="kwrd"&gt;typeof&lt;/span&gt; (Target))]
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Mixin: Mixin&amp;lt;Target&amp;gt;, IMixin 
{
  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; _cache = &lt;span class="kwrd"&gt;null&lt;/span&gt;;

  [OverrideTarget] &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetSomething ()
  {
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (_cache == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
      _cache = Base.GetSomething();
    &lt;span class="kwrd"&gt;return&lt;/span&gt; _cache;
  }  

  &lt;span class="kwrd"&gt;void&lt;/span&gt; ResetCache()
  {
    _cache = &lt;span class="kwrd"&gt;null&lt;/span&gt;;
  }
}

[CompleteInterface (&lt;span class="kwrd"&gt;typeof&lt;/span&gt; (Target))]
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; ICompleteTarget : ITarget, IMixin {} 

ICompleteTarget t = ObjectFactory.NewObject&amp;lt;ICompleteTarget&amp;gt;().With(&lt;span class="str"&gt;"stringArg"&lt;/span&gt;);&lt;/pre&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt;&lt;font face="Arial"&gt;This simply creates a mixin that caches the result of GetSomething(). This also points out the difference between mixins and generic AOP mechanisms: An AOP system would allow you to create code that caches every method/property (or lets you choose them based on attributes or regular expressions). Mixins are strictly non-generic. They work on known interfaces and methods, which means that we don't get the complexity overkill of AOP (but also not the full power of AOP).&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;(That said, there are ways to use the mixin infrastructure for more generic behavior, but that's a different story.)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Here's a short list of features: &lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Create full-featured mixins (implement new interfaces, override virtual methods/properties/events, call "base"-methods, keep state) using the most simple syntax we could possibly come up with. &lt;/li&gt;
    &lt;li&gt;Include one or more mixins from a target type (similar to multiple inheritance) and even override methods of the mixin OR &lt;/li&gt;
    &lt;li&gt;define a mixin for one or more existing types, and just have it magically applied to that type (as long as instances are created via a factory method). You can even create a mixin in a new assembly, copy it into an app's bin directory and have it picked up automatically, so that existing types just magically "change" (we're using this for product extensibility and product line development) &lt;/li&gt;
    &lt;li&gt;This even works if you apply multiple mixins to a single target type. If several mixins override the same method, they are automatically ordered based on their dependencies. &lt;/li&gt;
    &lt;li&gt;Automatically implement "complete interfaces", i.e. interfaces that include members of both target type and mixins, so you don't have to cast that much. &lt;/li&gt;
    &lt;li&gt;For those of us who use WebForms, which "new" up objects all the time without any chance to use a factory method, there is a special mechanism that replaces the static types in the markup with generated types at runtime. &lt;/li&gt;
    &lt;li&gt;You can apply mixins to any public, non-sealed type, and you may use any type as a mixin. For advanced features like overriding however, the type that does the overriding of course has to be mixin-aware. Also, mixins are easier to use if both target types and mixin types expose their features via interfaces, but this is not a requirement. &lt;/li&gt;
    &lt;li&gt;You can modify the static assignment of mixins to types at runtime. &lt;/li&gt;
    &lt;li&gt;Types with mixins are fully serializable (assuming that all underlying types are). &lt;/li&gt;
    &lt;li&gt;There's a load of advanced features, like copying mixin attributes to target types, reflecting on mixin types, customizing ordering via dependencies, manually instantiating mixins (behind the scenes, it's just composition after all), scoped configurations, imperative configuration, parallel class hierarchies between target and mixin types, and type deduction for generic mixin types, to name just a few. For those who really know what they are doing ;-) &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This sounds more complicated than it is, in most cases you just write a mixin class, optionally apply a few attributes for overriding, and then specify which mixins you want to use for which target type. We've used this library internally now for a few months, and feedback has been very good so far. It turned out that, while started primarily with a focus on product line development, mixins are a very useful general-purpose design tool. &lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Finally, a word about the preview version you can download from &lt;a href="http://www.re-motion.org/"&gt;here&lt;/a&gt;: It is not yet open source, basically because we didn't get around to finish all the work we need to do first (license headers etc). Since mixins are only a part of what re:motion is providing, this is quite a bit of work. The other thing is that we're using Castle's DynamicProxy library. That's because Reflection.Emit is a pain to work with directly (mostly because of the less-than-helpful error handling). So we're using DynamicProxy's type emitters, but we're not using its proxy mechanisms. So don't jump to any conclusions about our implementation just from the fact that we're referencing it.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;OK, that's it for today, download and have fun!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;- Stefan &lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;&lt;img src="http://re-motion.org/blogs/team/aggbug/11.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>re:motion Team</dc:creator>
            <guid>http://re-motion.org/blogs/team/archive/2008/02/20/introducing-mixins-finally.aspx</guid>
            <pubDate>Wed, 20 Feb 2008 02:54:40 GMT</pubDate>
            <wfw:comment>http://re-motion.org/blogs/team/comments/11.aspx</wfw:comment>
            <comments>http://re-motion.org/blogs/team/archive/2008/02/20/introducing-mixins-finally.aspx#feedback</comments>
            <wfw:commentRss>http://re-motion.org/blogs/team/comments/commentRss/11.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>