<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Jb in a nutshell: Category AspectDNG</title>
    <link>http://evain.net/blog/articles/category/aspectdng</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>At least I've slept in Seattle</title>
      <description>&lt;p&gt;&lt;br /&gt;&lt;p&gt;
Previously, in Jb in a nutshell: &lt;a href="http://evain.net/blog/index.php/2005/10/22/257-aop-goes-net-workshop"&gt;&lt;span class="caps"&gt;AOP&lt;/span&gt; Goes .NET Workshop&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
It was my first trip to US, and I liked it.&lt;br /&gt;
It was the first time I had to spend almost 24 hours in planes/airport (just for the trip back), and I hated it.&lt;br /&gt;
&lt;br /&gt;
Anyway, the workshop was interesting. It&amp;#8217;s clear that Microsoft don&amp;#8217;t know how to handle the &lt;span class="caps"&gt;AOP&lt;/span&gt; thing, but at least, it helped a bit. It was very interesting to meet people so motivated by working on &lt;span class="caps"&gt;AOP&lt;/span&gt; on .net. And now, they all know that they can use Cecil as a base assembly to write &lt;span class="caps"&gt;AOP&lt;/span&gt; tool!
I will write more on it later on.&lt;br /&gt;
&lt;br /&gt;
To make you wait, a little game, play to: &lt;a href="http://research.microsoft.com/workshops/aop/AOPattendees.jpg"&gt;where is Jb&lt;/a&gt; ?
&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 19 Nov 2005 21:13:19 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:7d549620ffb08794ca9d47be8f9b1d6d</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2005/11/19/at-least-ive-slept-in-seattle</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/41</trackback:ping>
    </item>
    <item>
      <title>AOP Goes .NET Workshop</title>
      <description>&lt;p&gt;&lt;br /&gt;&lt;h3&gt;I&amp;#8217;ll be there&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://research.microsoft.com/workshops/aop/"&gt;Microsoft Research &lt;span class="caps"&gt;AOP&lt;/span&gt; Goes .NET Workshop 2005&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
If you are around between Nov 12-16 and want to talk about AspectDNG and/or Mono.Cecil, drop me a mail !
&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 22 Oct 2005 15:08:11 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:8781aec6d38664552ffeeb794ff9562b</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2005/10/22/aop-goes-net-workshop</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/34</trackback:ping>
    </item>
    <item>
      <title>GMail TrayIcon</title>
      <description>&lt;p&gt;&lt;br /&gt;&lt;h3&gt;I&amp;#8217;ve played with Lego today&lt;/h3&gt;
&lt;p&gt;
Well, it was some kind of special Lego&amp;#8230; I&amp;#8217;ve taken bricks from :
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A nice tutorial about &lt;a href="http://mono-project.com/GtkSharpNotificationIcon"&gt;Tray Icons for &lt;span class="caps"&gt;GNOME&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;An perfect and simple &lt;a href="http://rlove.org/log/2004110201"&gt;example&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;An amazing &lt;a href="http://www.mono-live.com/"&gt;Mono Live&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;span class="caps"&gt;GPL&lt;/span&gt; icons from a nice &lt;a href="http://johnvey.com/features/gmailapi/"&gt;project&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;A simple &lt;a href="http://code.google.com/apis.html#gmail"&gt;&lt;span class="caps"&gt;ATOM&lt;/span&gt; feed&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
With those bricks, I&amp;#8217;ve made a very simple and totally incomplete &lt;b&gt;GMail Notification Icon for &lt;span class="caps"&gt;GNOME&lt;/span&gt;&lt;/b&gt;. It looks like that:
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img src="http://evain.net/public/gmailtray_nomail.png" /&gt;
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img src="http://evain.net/public/gmailtray_mails.png" /&gt;
&lt;/p&gt;
&lt;p&gt;
Yet, it&amp;#8217;s no really usable. Username and password are hard-coded, and you just know if you have, or not, unread mails.
&lt;/p&gt;
&lt;p&gt;
If someone is willing to use my code to produce a better applet, he would not have a lot of things to do. The list is simple:
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Use GConf to save username and password&lt;/li&gt;
  &lt;li&gt;Write a really simple window to ask user whether or not username and password have to be stored&lt;/li&gt;
  &lt;li&gt;Write another simple window to be shown when a new mail arrives, and then disappears&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
This nice person will find the code here: &lt;a href="http://evain.net/public/gmailtray.tar.gz"&gt;GMailTray&lt;/a&gt;
&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 08 Jun 2005 20:30:14 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:ac0c9a70eef045804764d044d7cb3d9a</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2005/06/08/gmail-trayicon</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/21</trackback:ping>
    </item>
    <item>
      <title>May starts</title>
      <description>&lt;p&gt;&lt;br /&gt;&lt;h3&gt;ildasm&lt;/h3&gt;
&lt;p&gt;
I&amp;#8217;ve spent two days refactoring the old code i&amp;#8217;ve wrote for ildasm. After that, i realized i was wrong in the way i should have made it. I&amp;#8217;m currently using the top level of Cecil, manipulating ITypeDefinition, ICustomAttribute, etc. This is plain wrong for a disassembler, that need more low level access. So i have to rewrite it using the middle level, manipulating metadata tables, signatures, byte arrays, etc. I have to go this way because there is a loss of data when you go a level up of abstraction, for instance, i miss all the metadata tokens, that Msft&amp;#8217;s ildasm prints in comments. I also want to implement natively the /adv switch of Msft&amp;#8217;s ildasm, that has been proved to be very usefull when you write compilers, or other assembly manipulating tools. Two days lost. It will learn me to think better before starting writing code i guess. As soon as i have something usable, you&amp;#8217;ll find it in the cecil module of Mono&amp;#8217;s &lt;span class="caps"&gt;SVN&lt;/span&gt;.
&lt;/p&gt;
&lt;h3&gt;Academic days&lt;/h3&gt;
&lt;p&gt;
I&amp;#8217;ve spent three days last week near the Eiffel tower, at Microsoft&amp;#8217;s academic days. Some very good sessions, one about the &lt;a href="http://research.microsoft.com/phoenix/"&gt;Phoenix project&lt;/a&gt;, guys, they are working on what i have in my mind for years. It&amp;#8217;s very impressive, maybe my school could apply to the academic program associated. I&amp;#8217;ve met Serge Lidin, that is the author of Microsoft&amp;#8217;s ildasm, ilasm, peverify, and so on. He talked about the future of the &lt;span class="caps"&gt;MSIL&lt;/span&gt; language, there is not a lot of work to provide to be .net 2 compatible in those tools. &lt;a href="http://blogs.labo-dotnet.com/patrice"&gt;Patrice&lt;/a&gt; have a pic of me, talking to both Serge Lidin and Mark Lewin, from the &lt;span class="caps"&gt;SSCLI&lt;/span&gt; project, (i&amp;#8217;m in the middle) :
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img src="http://blogs.labo-dotnet.com/patrice/images/msr2005_1623.png" /&gt;
&lt;/p&gt;
&lt;p&gt;
It seems that my talk about &lt;span class="caps"&gt;AOP&lt;/span&gt; and AspectDNG was not so bad, some people contratulate me after, and I had a lot of good questions. Anyway, people like researchers love &lt;span class="caps"&gt;AOP&lt;/span&gt;. You can download my slides : &lt;a href="http://evain.net/public/msraop.ppt"&gt;&amp;#8220;Meet Alice&amp;#8221;&lt;/a&gt; (yeah, AspectDNG is wonderful&amp;#8230;, sorry, it is written in french). So it was three real good days (eating very good food for free, in an hotel the room was bigger than my apartment during three days was cool too).
&lt;/p&gt;
&lt;p&gt;
A funny anecdote, there was a little talk about Mono, it was quite good, the guy used my slides from the DotNetGuru&amp;#8217;s Symposium, and at the end, he claims that he wanted to show the PetShopDNG running on the top of &lt;span class="caps"&gt;XSP&lt;/span&gt;, but that &lt;i&gt;it does not works&lt;/i&gt;. He tried, but &lt;span class="caps"&gt;XSP&lt;/span&gt; was reporting an exception. Fortunately, i&amp;#8217;ve made running the PetShopDNG on Mono, and i&amp;#8217;ve even presented it at the DotNetGuru&amp;#8217;s Symposium, and i saw the exception. In fact, the PetShopDNG was simply misconfigured. I told it to the guy, that invited me to make this thing work. After two little changes in the Web.config, the PetShopDNG was running on the top of &lt;span class="caps"&gt;XSP&lt;/span&gt;, without any modification. Really cool. As it was the end of the talk, i&amp;#8217;ve asked for questions about Mono, and for 15 minutes, i&amp;#8217;ve answered to them. It&amp;#8217;s good too see that people are really interested in Mono.
&lt;/p&gt;
&lt;h3&gt;Levenshtein Distance&lt;/h3&gt;
&lt;p&gt;
Following &lt;a href="http://nat.org"&gt;Nat&lt;/a&gt;&amp;#8217;s links, i&amp;#8217;ve discovered the &lt;a href="http://www.merriampark.com/ld.htm"&gt;Levenshtein Distance algorithm&lt;/a&gt;, so i decided to write it in C#. Thanks to others examples, it was really easy, and i still don&amp;#8217;t know why i did that. You&amp;#8217;ll find the whole stuff, including simples tests here : &lt;a href="http://evain.net/public/Levenshtein.zip"&gt;http://evain.net/public/Levenshtein.zip&lt;/a&gt;.
&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 02 May 2005 14:04:41 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:cec7b0de610d82c20e78f63e35f63ade</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2005/05/02/may-starts</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/17</trackback:ping>
    </item>
    <item>
      <title>The Module, a new Design Pattern ?</title>
      <description>&lt;p&gt;&lt;br /&gt;&lt;p&gt;
I&amp;#8217;m partially enthusiast about the partial classes. Here is a sample of code that a French Microsoftee presented to us :
&lt;/p&gt;
&amp;lt;!&lt;del&gt;- code formatted by http://manoli.net/csharpformat/ -&lt;/del&gt;&amp;gt;
&lt;pre class="csharpcode"&gt;
&amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;partial&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; Person
{
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; firstname;
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; lastname;

    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; Person (&amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; firstname, &amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; lastname)
    {
        &amp;lt;span class="kwrd"&amp;gt;this&amp;lt;/span&amp;gt;.firstname = firstname;
        &amp;lt;span class="kwrd"&amp;gt;this&amp;lt;/span&amp;gt;.lastname = lastname;
    }

    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; Format ()
    {
        &amp;lt;span class="rem"&amp;gt;// ...&amp;lt;/span&amp;gt;
    }
}

&amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;partial&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; Person
{
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;static&amp;lt;/span&amp;gt; Person FromDataRow (DataRow r)
    {
        &amp;lt;span class="rem"&amp;gt;// ...&amp;lt;/span&amp;gt;
    }

    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;static&amp;lt;/span&amp;gt; Person FromAnotherDataSource (DS s)
    {
        &amp;lt;span class="rem"&amp;gt;// ..&amp;lt;/span&amp;gt;
    }
}&lt;/pre&gt;
&lt;p&gt;
Isn&amp;#8217;t it a neat design ? Grrrr, I know this is only a sample, to explain the partial keyword, but i &lt;i&gt;know&lt;/i&gt; that lots of people will use it this way. Please, use only the partial keyword where it is meant to be.
&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 25 Apr 2005 15:31:04 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:f21ee83041b177b1d84c154119c9ba99</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2005/04/25/the-module-a-new-design-pattern</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/16</trackback:ping>
    </item>
    <item>
      <title>April come she will</title>
      <description>&lt;p&gt;&lt;br /&gt;&lt;h3&gt;Tech&amp;#8217;Ed&lt;/h3&gt;
&lt;p&gt;
Microsoft invited me to the &lt;a href="http://www.mseventseurope.com/teched/05/pre/content/default.aspx"&gt;Tech&amp;#8217;Ed Europe&lt;/a&gt;, some &lt;a href="http://www.mseventseurope.com/TechEd/05/Pre/Content/SessionList.aspx"&gt;sessions&lt;/a&gt; seems very promising. The good point is that I have not yet visited Amsterdam, this is the occasion. I hope to see people there, feel free to mail.
&lt;/p&gt;
&lt;h3&gt;AspectDNG&lt;/h3&gt;
&lt;p&gt;
Thomas Gil have started using Cecil to produce &lt;span class="caps"&gt;ILML&lt;/span&gt; inside &lt;a href="http://aspectdng.sourceforge.net"&gt;AspectDNG&lt;/a&gt;, sounds like he is waiting for me to end my job, so that he can use Cecil to convert an &lt;span class="caps"&gt;ILML&lt;/span&gt; file to a valid assembly.
&lt;/p&gt;
&lt;h3&gt;OPath&lt;/h3&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetguru2.org/sebastienros"&gt;Sebastien Ros&lt;/a&gt; offered me for Christmas his OPath parser library. Two options, I can write a clone of its Eon library that uses it, so that we could query objects graphs, just like Sebastien &lt;a href="http://www.dotnetguru2.org/sebastienros/index.php?p=159&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1"&gt;does&lt;/a&gt;. If I go this way, the Evaluate method should be a generic one, so that we could return strongly typed collections or items. The second option is to integrate natively into Cecil the ability to query the assembly, but it is too much Cecil centric, I&amp;#8217;m sure other people wants to play with OPath !
&lt;/p&gt;
&lt;h3&gt;Microsoft Research&lt;/h3&gt;
&lt;p&gt;
I&amp;#8217;m finishing my slides for Tuesday, again, the agenda is very promising, the thematic this year is &lt;i&gt;Software Engineering, Architectural Design and High Performance Computing&lt;/i&gt;. Hope they&amp;#8217;ll enjoy &lt;span class="caps"&gt;AOP&lt;/span&gt; AspectDNG&amp;#8217;s way. I&amp;#8217;ll be hosted &lt;a href="http://www.novotel.com/novotel/fichehotel/gb/nov/3546/fiche_hotel.shtml"&gt;there&lt;/a&gt;, (even if I live at 15 minutes from there). Every details &lt;a href="http://galilee.microsoft.fr/JA2005"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;h3&gt;XScale&lt;/h3&gt;
&lt;p&gt;
I&amp;#8217;ve look toward installing Linux on my Dell Axim &lt;span class="caps"&gt;X30&lt;/span&gt; (I don&amp;#8217;t really know what to do with it), but it looks like it will be a &lt;b&gt;very&lt;/b&gt; time consuming task, the Linux port is not &lt;a href="http://www.handhelds.org/moin/moin.cgi/AximX30"&gt;really ready&lt;/a&gt;. However, I&amp;#8217;ve added a new entry in my &lt;span class="caps"&gt;TODO&lt;/span&gt; list: trying to port Mini, Mono&amp;#8217;s &lt;span class="caps"&gt;JIT&lt;/span&gt;, to this architecture, so that I can learn from inside the Mono runtime. I&amp;#8217;ll need help, but &lt;a href="http://primates.ximian.com/~massi/blog/"&gt;Massi&lt;/a&gt; said one time that he was working on this on his spare time, and there is some interesting threads in the devel list to read fist. Sounds like it is a good holiday work, but I have to finish Cecil first!
&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 24 Apr 2005 14:44:47 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:0d26ba9432c6aab18b379e4954d167d7</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2005/04/24/april-come-she-will</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/15</trackback:ping>
    </item>
    <item>
      <title>Journée Académiques 2005</title>
      <description>&lt;p&gt;&lt;br /&gt;I have the honor to be one of the speaker of the &amp;#8220;Academic Days&amp;#8221; event, my talk is about Aspect Oriented Programming on the .net framework.&lt;br /&gt;
&lt;br /&gt;
I have to admit that i&amp;#8217;m really impressed, I&amp;#8217;ll meet there people like John Lefor, PM for the Phoenix project at &lt;span class="caps"&gt;MSR&lt;/span&gt;. It seems that we share some ideas on compiler design, I hope I&amp;#8217;ll be able to talk with him a little. Serge Lidin, the author of Inside .NET IL Assembler, and the writer of ildasm, ilasm, peverify, ..., will be here too, talking about the the evolution of the &lt;span class="caps"&gt;CIL&lt;/span&gt;. Be sure I&amp;#8217;ll hear carefully ! Should be 3 exciting days ! All details &lt;a href="http://galilee.microsoft.fr/JA2005/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Wed, 23 Mar 2005 23:59:30 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:fc10f89886e285df4f832fcd46262654</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2005/03/23/journ%E9e+acad%E9miques-2005</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/13</trackback:ping>
    </item>
    <item>
      <title>White box unit testing with AspectDNG</title>
      <description>&lt;p&gt;&lt;br /&gt;Last time, Tom was kidding me (softly) about the fact that we can do almost everything we want with AspectDNG. I begin to think he wasn&amp;#8217;t wrong&amp;#8230;&lt;br /&gt;
&lt;br /&gt;
Once again, here is a very, very complex system that should be hard tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!&lt;del&gt;- code formatted by http://manoli.net/csharpformat/ -&lt;/del&gt;&amp;gt;
&lt;pre class="csharpcode"&gt;
&amp;lt;span class="rem"&amp;gt;// Main.cs&amp;lt;/span&amp;gt;

&amp;lt;span class="kwrd"&amp;gt;using&amp;lt;/span&amp;gt; System;

&amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; ComplexSystem {

    &amp;lt;span class="kwrd"&amp;gt;private&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;int&amp;lt;/span&amp;gt; m_secret;

    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; ComplexSystem() {
        m_secret = 0;
    }

    &amp;lt;span class="kwrd"&amp;gt;private&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; SecretOperation(&amp;lt;span class="kwrd"&amp;gt;int&amp;lt;/span&amp;gt; oper) {
        m_secret += oper;
    }

    &amp;lt;span class="rem"&amp;gt;// should always return a multiple of 2&amp;lt;/span&amp;gt;
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;int&amp;lt;/span&amp;gt; PublicOperation() {
        &amp;lt;span class="kwrd"&amp;gt;if&amp;lt;/span&amp;gt; ((m_secret % 2) != 0) {
            SecretOperation(1);
        }
        &amp;lt;span class="kwrd"&amp;gt;return&amp;lt;/span&amp;gt; m_secret;
    }
}
&lt;/pre&gt;
&lt;br /&gt;
This can be safely compiled to a Main.dll.&lt;br /&gt;
Ok, this ComplexSystem is the central point of your next application, you &lt;span class="caps"&gt;NEED&lt;/span&gt; to test it. What can be better than NUnit ? But here is the problem, you would like to be sure that the secret operation have a correct behaviour, and that the m_secret field is well setted&amp;#8230; Two way to do that, first you use boring Reflection, or you can even take a look behind your back, you ensure that you&amp;#8217;re alone, you change the visibility of all this, but you promise yourself that you&amp;#8217;ll change it as soon as tests passed. Also you may note that somewhere not to forgot, this is a &lt;span class="caps"&gt;SECRET&lt;/span&gt; operation.&lt;br /&gt;
&lt;br /&gt;
What about introducing a new way of testing this ? Using AspectDNG ? Something I may call white box unit testing ? Here is one aspect to do that :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!&lt;del&gt;- code formatted by http://manoli.net/csharpformat/ -&lt;/del&gt;&amp;gt;
&lt;pre class="csharpcode"&gt;
&amp;lt;span class="rem"&amp;gt;// Tests.cs&amp;lt;/span&amp;gt;

&amp;lt;span class="kwrd"&amp;gt;using&amp;lt;/span&amp;gt; System;
&amp;lt;span class="kwrd"&amp;gt;using&amp;lt;/span&amp;gt; NUnit.Framework;

&amp;lt;span class="rem"&amp;gt;// dummy complex system, may have been generated&amp;lt;/span&amp;gt;
&amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; ComplexSystem {
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;int&amp;lt;/span&amp;gt; m_secret;
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; SecretOperation(&amp;lt;span class="kwrd"&amp;gt;int&amp;lt;/span&amp;gt; oper) {}
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;int&amp;lt;/span&amp;gt; PublicOperation() { &amp;lt;span class="kwrd"&amp;gt;return&amp;lt;/span&amp;gt; 0; }
}

[TestFixture]
&amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; TestComplexSystem {

    &amp;lt;span class="kwrd"&amp;gt;private&amp;lt;/span&amp;gt; ComplexSystem m_complexSystem;

    [SetUp]
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; SetUp() {
        m_complexSystem = &amp;lt;span class="kwrd"&amp;gt;new&amp;lt;/span&amp;gt; ComplexSystem();
    }

    [Test]
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; TestPublicOperation() {
        Assert.AreEqual(0, m_complexSystem.PublicOperation() % 2);
        m_complexSystem.SecretOperation(1);
        m_complexSystem.SecretOperation(1);
        m_complexSystem.SecretOperation(1);
        Assert.AreEqual(0, m_complexSystem.PublicOperation() % 2);
        Assert.AreEqual(4, m_complexSystem.PublicOperation());
    }

    [Test]
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; TestFieldSecret() {
        Assert.AreEqual(0, m_complexSystem.m_secret);
        m_complexSystem.SecretOperation(1);
        Assert.AreEqual(1, m_complexSystem.m_secret);
    }

    [Test]
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; TestSecretOperation() {
        &amp;lt;span class="kwrd"&amp;gt;int&amp;lt;/span&amp;gt; cursor = m_complexSystem.m_secret;
        m_complexSystem.SecretOperation(12);
        Assert.AreEqual(12, m_complexSystem.m_secret - cursor);
    }
}
&lt;/pre&gt;
&lt;br /&gt;
What can we see there ? I use a dummy ComplexSystem, that looks like really close to the real one no ? It is just a trick, with that, I&amp;#8217;ll be able to compile this single file into a Tests.dll assembly. Once this is done, all I have to do it to inject the content of my TestComplexSystem into the real ComplexSystem. This can be done with the standard MetaAspect Insert from AspectDNG.&lt;br /&gt; When weaving is done, after using a simple insert advice, here is the result :&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://evain.net/public/unit_testing_aop.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#8220;Et voila&amp;#8221;, the ComplexSystem is now a test fixture itself. Pretty simple no ?&lt;br /&gt;
And this sample works with Mono. Of course it is a very lightweight one, but hey, it looks good !&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;:&lt;/b&gt; You can download the sources of the example &lt;a href="http://evain.net/public/unit_testing_adng.zip"&gt;here&lt;/a&gt;. Just compile as described in the post, and run AspectDNG -w on the AspectDNG.xml provided.&lt;br /&gt;
&lt;br /&gt;
So, what do you think about this kind of unit testing ? I&amp;#8217;m curious about you opinion !&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 13 Jan 2005 01:16:21 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:4b2ba52b8529285392b77ca7a31e985a</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2005/01/13/white-box-unit-testing-with-aspectdng</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/9</trackback:ping>
    </item>
    <item>
      <title>new DotNetIde(&amp;quot;x-develop&amp;quot;);</title>
      <description>&lt;br /&gt;This morning Hans Cratz announced in the Mono Devel List the preview release of the new x-develop &lt;span class="caps"&gt;IDE&lt;/span&gt;.&lt;br /&gt;
I&amp;#8217;m currently trying it, and you know what ? I&amp;#8217;m happy. I&amp;#8217;m switching my current development to it, just to see. At least it seems to be very promising. I have to admit I&amp;#8217;m a bit jealous, it seems that I&amp;#8217;m not the only one to want an Eclipse#. Yes, it is cross platform, and if I&amp;#8217;ve not tried it under my Linux box, be sure I will.&lt;br /&gt;
&lt;br /&gt;
Here is a quote from the mail :&lt;br /&gt;
&lt;blockquote&gt;
Feature showcase:&lt;br /&gt;
&lt;br /&gt;
	&lt;ul&gt;
	&lt;li&gt;Instant detection of errors throughout all files&lt;br /&gt;
&lt;br /&gt;
No need to compile in order to find out if there are errors. X-develop checks all files in the solution on-the-fly in the background and displays errors in an instant.&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
		&lt;li&gt;Refactoring&lt;br /&gt;
&lt;br /&gt;
X-develop includes refactorings for renaming variables, methods, classes, changing method signature, extracting methods and more.&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
		&lt;li&gt;Productivity features&lt;br /&gt;
&lt;br /&gt;
X-develop boosts productivity with coding tools such as Organize imports, Usage search, Code formatting, Smart templates, Go to class, Go to symbol and more.&lt;br /&gt;
&lt;br /&gt;&lt;/li&gt;
		&lt;li&gt;VS.net 2005 compatibility&lt;br /&gt;
&lt;br /&gt;
X-develop uses the solutio/project concept from VS.net 2005. Solutions/projects created for Windows can be loaded and modified with X-develop on Linux.
&lt;/blockquote&gt;
&lt;br /&gt;
It rocks. I&amp;#8217;m now playing with code templates, code metrics. There is a lot of good stuff in this. I&amp;#8217;ve not enough time to write a complete review of it, but it&amp;#8217;s an interesting article idea for &lt;span class="caps"&gt;DNG&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Go, try it, and make your own idea. My question now is will it be free ?&lt;br /&gt;
&lt;br /&gt;
Some links :&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://evain.net/public/xdevelop_first.png"&gt;My first screenshot of the beast&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://www.x-develop.com/index.htm"&gt;X-Develop Home&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Edit&lt;/b&gt;&lt;br /&gt;
I was so excited that I did not even notice that it is written in Java, but does it cares ? A little, I think an Eclipse# written in .net should be a very exciting thing.&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Mon, 20 Dec 2004 14:06:55 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:80b47ca606a1c88a915503dbe8fe6615</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2004/12/20/new-dotnetide-x-develop</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/5</trackback:ping>
    </item>
    <item>
      <title>Type 6 IOC, weaving the dependency</title>
      <description>&lt;p&gt;&lt;br /&gt;&lt;blockquote&gt;
Everybody&amp;#8217;s gone weavin&amp;#8217;,&lt;br /&gt;
Weavin&amp;#8217; D.N.G. !&lt;br /&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
Life is a beach, let&amp;#8217;s try a new meta aspect : ReplaceConstructorCall,
and by the way, discover a new type of &lt;span class="caps"&gt;IOC&lt;/span&gt;, not constructor based, not setter based,
everything is done by AspectDNG. Maybe this is not even &lt;span class="caps"&gt;IOC&lt;/span&gt;. Don&amp;#8217;t care, it&amp;#8217;s cool.&lt;br /&gt;
&lt;br /&gt;
I&amp;#8217;ve written this today, it&amp;#8217;s some kind of proof of concept. It is in &lt;span class="caps"&gt;CVS&lt;/span&gt; now, but maybe it will
evolve or change. &lt;span class="caps"&gt;IOC&lt;/span&gt; is one buzz word of today. In one of his (famous) article, in &lt;a href="http://dotnetguru.org/article.php?sid=347"&gt;French&lt;/a&gt;,
and in &lt;a href="http://www.dotnetguru.org/us/modules.php?op=modload&amp;amp;name=News&amp;amp;file=article&amp;amp;sid=24"&gt;English&lt;/a&gt;, Sami Jaber describes 3 types of commonly used &lt;span class="caps"&gt;IOC&lt;/span&gt;, interface based, getter based, and constructor based.
I have named this  blog entry after this &lt;a href="http://www.theserverside.com/news/thread.tss?thread_id=30341"&gt;article&lt;/a&gt; on tss. Mainly
because I&amp;#8217;m not really serious. However, I think that &lt;span class="caps"&gt;AOP&lt;/span&gt; may &amp;#8220;eclipse&amp;#8221; &lt;span class="caps"&gt;IOC&lt;/span&gt;.&lt;br /&gt; An example is coming.&lt;br /&gt;
&lt;br /&gt;
The beginning, a very simple set of base classes :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;
&amp;lt;span class="rem"&amp;gt;// base.cs&amp;lt;/span&amp;gt;
&amp;lt;span class="kwrd"&amp;gt;namespace&amp;lt;/span&amp;gt; AspectDNG.Sample {

    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;interface&amp;lt;/span&amp;gt; IComplexSystem {
        &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; DoTheWholeThing(&amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; a);
    }

    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; MockSystem : IComplexSystem {
        &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; MockSystem() {}
        &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; DoTheWholeThing(&amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; a) {}
    }

    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; Pono {

        &amp;lt;span class="kwrd"&amp;gt;private&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; m_a;
        &amp;lt;span class="kwrd"&amp;gt;private&amp;lt;/span&amp;gt; IComplexSystem m_system = &amp;lt;span class="kwrd"&amp;gt;new&amp;lt;/span&amp;gt; MockSystem();

        &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; Pono(&amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; a) {
            m_a = a;
        }

        &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; TryTheThing() {
            m_system.DoTheWholeThing(m_a);
        }
    }

    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; EntryPoint {

        &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; Main(&amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt;[] args) {
            Pono p = &amp;lt;span class="kwrd"&amp;gt;new&amp;lt;/span&amp;gt; Pono(&amp;lt;span class="str"&amp;gt;"HELLO IOC6 !"&amp;lt;/span&amp;gt;);
            p.TryTheThing();
        }
    }
}
&lt;/pre&gt;
&lt;br /&gt;
What can we see there ? An interface, describing a complex system we want to use, then a Mock object, that may be avoided,
but that is there for type safety, and for bookmarking. After this you find a plain old .net object, that depends on
our complex system. The entry point creates the Pono object, and ask him to call its dependency. If you compile that and call it, nothing will
happens. Let&amp;#8217;s weave the dependencies ! Here is my aspect :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharpcode"&gt;
&amp;lt;span class="rem"&amp;gt;// aspect.cs&amp;lt;/span&amp;gt;
&amp;lt;span class="kwrd"&amp;gt;namespace&amp;lt;/span&amp;gt; AspectDNG.Sample {

    &amp;lt;span class="kwrd"&amp;gt;using&amp;lt;/span&amp;gt; AspectDNG;

    [Insert(&amp;lt;span class="str"&amp;gt;"module:"&amp;lt;/span&amp;gt;)]
    &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;class&amp;lt;/span&amp;gt; RealComplexSystem : IComplexSystem {

        [ReplaceConstructorCall(&amp;lt;span class="str"&amp;gt;"* *.MockSystem::.ctor()"&amp;lt;/span&amp;gt;)]
        &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; RealComplexSystem() {}

        &amp;lt;span class="kwrd"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class="kwrd"&amp;gt;void&amp;lt;/span&amp;gt; DoTheWholeThing(&amp;lt;span class="kwrd"&amp;gt;string&amp;lt;/span&amp;gt; a) {
            System.Console.WriteLine(a.ToLower());
        }
    }
}
&lt;/pre&gt;
This is a concrete implementation of my complex service. I use custom attributes to describe that I want RealComplexSystem to be
inserted in the main module of the target assembly, and I use my new ReplaceConstructorCall. It&amp;#8217;s explicit, every call to the constructor
of MockSystem will be replaced by the constructor of RealComplexSystem. It rocks no ?&lt;br /&gt;
&lt;br /&gt;
If I execute this, my complex system will do its job :&lt;br /&gt;
&lt;pre&gt;
D:/temporary/adng&amp;amp;gt;AspectDNG -dw base.exe aspect.dll
D:/temporary/adng&amp;amp;gt;base
hello ioc6 !
D:/temporary/adng&amp;amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
So, what do you think about this ?&lt;br /&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 16 Dec 2004 17:14:34 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:c0c176f14bef7b577cc836126ca7ab72</guid>
      <author>jbevain</author>
      <link>http://evain.net/blog/articles/2004/12/16/type-6-ioc-weaving-the-dependency</link>
      <category>AspectDNG</category>
      <trackback:ping>http://evain.net/blog/articles/trackback/4</trackback:ping>
    </item>
  </channel>
</rss>
