<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-23541384</id><updated>2012-01-23T04:34:17.177-08:00</updated><category term='Personal'/><category term='SFT'/><category term='VS Extensibility'/><category term='Volta'/><category term='Web Dev'/><category term='Conferences'/><category term='Methodologies'/><category term='GAX/GAT'/><category term='Java'/><category term='Entlib'/><category term='.Net'/><title type='text'>Adrian Alonso</title><subtitle type='html'>adalonobject.getBlogger().show()</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-23541384.post-1208760870563988326</id><published>2008-04-20T08:58:00.001-07:00</published><updated>2008-04-20T08:58:56.185-07:00</updated><title type='text'>How-to get the XML representacion of a DSL Model Element</title><content type='html'>&lt;p&gt;Today I had to find out how to get the XML representacion of a DSL Model Element. Here you have an extension method for Model Elements (mels)&amp;nbsp;that gets the concrete serializer using the Domain XML Serializer Directory and the Domain Class Id of the target Model Element (mel).&lt;/p&gt;&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetXML(&lt;span class="kwrd"&gt;this&lt;/span&gt; ModelElement mel)&lt;br /&gt;        {&lt;br /&gt;            StringBuilder xml = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder();&lt;br /&gt;            &lt;br /&gt;            DomainXmlSerializerDirectory directory = &lt;span class="kwrd"&gt;new&lt;/span&gt; DomainXmlSerializerDirectory();&lt;br /&gt;            directory.AddBehavior(CoreDesignSurfaceSerializationBehavior.Instance);&lt;br /&gt;            directory.AddBehavior(&amp;lt;#Yours DSL Serialization Behavior goes here #&amp;gt;.Instance);&lt;br /&gt;            // Gets the serializer of the Mel&lt;/pre&gt;&lt;pre class="csharpcode"&gt;            DomainClassXmlSerializer serializer = directory.GetSerializer(mel.GetDomainClass().Id);&lt;br /&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (serializer != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br /&gt;            {&lt;br /&gt;                &lt;span class="kwrd"&gt;using&lt;/span&gt; (XmlWriter writer = XmlWriter.Create(&lt;span class="kwrd"&gt;new&lt;/span&gt; StringWriter(xml)))&lt;br /&gt;                {&lt;br /&gt;                    serializer.Write(&lt;span class="kwrd"&gt;new&lt;/span&gt; SerializationContext(directory), mel, writer);&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;            {&lt;br /&gt;                Trace.TraceWarning(Resources.UnableToGetSerializer, mel.GetType().Name);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; xml.ToString();&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;HTH,&lt;/pre&gt;&lt;pre class="csharpcode"&gt;Adrian&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-1208760870563988326?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/1208760870563988326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=1208760870563988326' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/1208760870563988326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/1208760870563988326'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2008/04/how-to-get-xml-representacion-of-dsl.html' title='How-to get the XML representacion of a DSL Model Element'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-2906006299616946860</id><published>2007-10-18T04:56:00.001-07:00</published><updated>2007-10-18T05:52:44.770-07:00</updated><title type='text'>Clarius T4 Editor is out!</title><content type='html'>&lt;p&gt;The beta version is available at &lt;a title="http://www.t4editor.net" href="http://www.t4editor.net"&gt;http://www.t4editor.net&lt;/a&gt;. You can go, download it and provide some feedback at the &lt;a href="http://forums.clariusconsulting.net/viewforum.php?f=9"&gt;Clarius T4 Forum&lt;/a&gt;&amp;nbsp;which will be very valuable for us (Clarius) to prioritize the most important features for the RTM version!&lt;/p&gt; &lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/adalon/t4editor-banner.JPG"&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Here is you have the&amp;nbsp; links:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.clariusconsulting.net/blogs/vga/archive/2007/10/18/35477.aspx"&gt;Victor's official announcement&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.t4editor.net"&gt;Clarius T4 Editor Site&lt;/a&gt;&lt;br&gt;&lt;a href="http://forums.clariusconsulting.net/viewforum.php?f=9"&gt;Clarius T4 Editor Forums&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.t4editor.net/downloads.html"&gt;Clarius T4 Editor Download&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Thanks!&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-2906006299616946860?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/2906006299616946860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=2906006299616946860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2906006299616946860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2906006299616946860'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/10/clarius-t4-editor-is-out.html' title='Clarius T4 Editor is out!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-6379757629885603267</id><published>2007-10-17T08:49:00.001-07:00</published><updated>2007-10-17T08:49:32.760-07:00</updated><title type='text'>Clarius is Hiring!</title><content type='html'>&lt;p&gt;As &lt;a href="http://weblogs.asp.net/cibrax/"&gt;Pablo&lt;/a&gt; said in his &lt;a href="http://weblogs.asp.net/cibrax/archive/2007/10/17/clarius-is-hiring.aspx"&gt;post&lt;/a&gt; &lt;a href="http://www.clariusconsulting.net"&gt;Clarius&lt;/a&gt; is looking for candidates to fill Senior Dev Positions. You can check the details in &lt;a href="http://weblogs.asp.net/cibrax/archive/2007/10/17/clarius-is-hiring.aspx"&gt;Pablo's post&lt;/a&gt; too and if you are interested you can ping &lt;a href="http://weblogs.asp.net/cibrax/"&gt;Pablo&lt;/a&gt;, &lt;a href="http://weblogs.asp.net/adalon/contact.aspx"&gt;me&lt;/a&gt; (alo&amp;nbsp;AT clariusconsulting&amp;nbsp;DOT net or through the &lt;a href="http://weblogs.asp.net/adalon/contact.aspx"&gt;contact form&lt;/a&gt; of this blog) or send your&amp;nbsp;resume directly to Clarius job alias (which you can find in &lt;a href="http://www.clariusconsulting.net"&gt;www.clariusconsulting.net&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;Thanks!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-6379757629885603267?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/6379757629885603267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=6379757629885603267' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6379757629885603267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6379757629885603267'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/10/clarius-is-hiring_17.html' title='Clarius is Hiring!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-3524035676421997078</id><published>2007-10-17T08:46:00.001-07:00</published><updated>2007-10-17T08:46:49.712-07:00</updated><title type='text'>Clarius is Hiring!</title><content type='html'>&lt;p&gt;As &lt;a href="http://weblogs.asp.net/cibrax/"&gt;Pablo&lt;/a&gt; said in his &lt;a href="http://weblogs.asp.net/cibrax/archive/2007/10/17/clarius-is-hiring.aspx"&gt;post&lt;/a&gt; Clarius is looking for candidates to fill Senior Dev Positions. You can check the details in &lt;a href="http://weblogs.asp.net/cibrax/archive/2007/10/17/clarius-is-hiring.aspx"&gt;Pablo's post&lt;/a&gt; too and if you are interested you can ping &lt;a href="http://weblogs.asp.net/cibrax/"&gt;Pablo&lt;/a&gt;, &lt;a href="http://weblogs.asp.net/adalon/contact.aspx"&gt;me&lt;/a&gt; (alo&amp;nbsp;AT clariusconsulting&amp;nbsp;DOT net or through the &lt;a href="http://weblogs.asp.net/adalon/contact.aspx"&gt;contact form&lt;/a&gt; of this blog) or send your&amp;nbsp;resume directly to Clarius job alias (which you can find in &lt;a href="http://www.clariusconsulting.net"&gt;www.clariusconsulting.net&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;Thanks!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-3524035676421997078?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/3524035676421997078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=3524035676421997078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/3524035676421997078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/3524035676421997078'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/10/clarius-is-hiring.html' title='Clarius is Hiring!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-1621792648666340945</id><published>2007-09-27T11:37:00.001-07:00</published><updated>2007-09-27T11:37:48.894-07:00</updated><title type='text'>runas cmd makes your life easier</title><content type='html'>&lt;p&gt;This week I had to temporaly&amp;nbsp;use a different user on my machine. So at first I thought I had to move all my settings (outlook profile, firefox bookmarks, vms, etc)&amp;nbsp;from my primary user to this new one. This is not a nice task. Hopefully I remembered the &lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/runas.mspx?mfr=true"&gt;runas&lt;/a&gt; command which allowed me to run the above programs (indeed I'm currently creating this post&amp;nbsp;running WLW&amp;nbsp;using&amp;nbsp;runas)&amp;nbsp;as my primary user from the new user&amp;nbsp;session. IMO this is definitily a very good tip if you have the same scenario in the feature.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-1621792648666340945?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/1621792648666340945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=1621792648666340945' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/1621792648666340945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/1621792648666340945'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/09/runas-cmd-makes-your-life-easier.html' title='runas cmd makes your life easier'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-4965979716677636046</id><published>2007-09-26T07:37:00.001-07:00</published><updated>2007-09-26T07:37:02.655-07:00</updated><title type='text'>Read source code to be a better developer</title><content type='html'>&lt;p&gt;I want to give it a try.&amp;nbsp;My idea is to take a look at one or two projects every week and post some conclusions of what I could learn of them. Here you have for example&amp;nbsp;the latest&amp;nbsp;&lt;a href="http://www.hanselman.com/blog/TheWeeklySourceCode6.aspx"&gt;Scott Hanselman's post&lt;/a&gt; showing his weekly results.&amp;nbsp;&amp;nbsp;So if you have in mind a really cool source code stuff, please&amp;nbsp;feel free to&amp;nbsp;ping me (leaving a comment to this post or using the contact me link) and let me know where I can get it!&amp;nbsp; Thanks!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-4965979716677636046?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/4965979716677636046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=4965979716677636046' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4965979716677636046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4965979716677636046'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/09/read-source-code-to-be-better-developer.html' title='Read source code to be a better developer'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-4237218685884113395</id><published>2007-09-11T07:44:00.001-07:00</published><updated>2007-09-11T07:44:13.506-07:00</updated><title type='text'>Adding a custom VS Task List Token</title><content type='html'>&lt;p&gt;You probably used the TODO task list token to add a comment about what it should be done. But what about if you want to use a custom token to add a different kind of comment; for example a Review(x) comment. VS allows you to add custom task list token via Tools-&amp;gt;Options-&amp;gt;Environment-&amp;gt;Task List as it's shown in the following screenshot:&lt;/p&gt; &lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/adalon/tasklisttokens01.JPG"&gt; &lt;/p&gt; &lt;p&gt;So then you will able to add the Review comments and&amp;nbsp;these will be appearing in the Task List comments section:&lt;/p&gt; &lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/adalon/tasklisttokens02.JPG"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-4237218685884113395?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/4237218685884113395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=4237218685884113395' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4237218685884113395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4237218685884113395'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/09/adding-custom-vs-task-list-token.html' title='Adding a custom VS Task List Token'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-2932935351710280963</id><published>2007-09-07T10:43:00.001-07:00</published><updated>2007-09-10T05:54:39.512-07:00</updated><title type='text'>My blog is also on asp.net weblogs!</title><content type='html'>&lt;p&gt;A few days ago I got an account to start blogging at weblogs.asp.net. So I decided to move the latest posts using a cool tool &lt;a href="http://weblogs.asp.net/jescrich"&gt;jes&lt;/a&gt; did and for now my idea is to post the same content&amp;nbsp;in both blogger and asp.net blogs. I'm also considering the alternative of using the &lt;a href="http://www.codeplex.com/clarius"&gt;Cross-Post plugin&lt;/a&gt; &lt;a href="http://www.clariusconsulting.net/blogs/kzu/"&gt;kzu&lt;/a&gt; did. So you can check the&amp;nbsp;&lt;a href="http://weblogs.asp.net/adalon"&gt;new blog&lt;/a&gt;&amp;nbsp;on asp.net and leave a comment if want to as well!&amp;nbsp;&lt;/p&gt; &lt;p&gt;adalon on asp.net weblogs: &lt;a href="http://weblogs.asp.net/adalon"&gt;http://weblogs.asp.net/adalon&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-2932935351710280963?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/2932935351710280963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=2932935351710280963' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2932935351710280963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2932935351710280963'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/09/my-blog-is-also-on-aspnet-weblogs-too.html' title='My blog is also on asp.net weblogs!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-4545503440536581135</id><published>2007-09-07T10:35:00.001-07:00</published><updated>2007-09-07T10:35:59.346-07:00</updated><title type='text'>TCI - Toolbox Controls Installer</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;TCI is a VS Package that is provided by the VS SDK as a redist. TCI allows you to easily add&amp;nbsp;your custom&amp;nbsp;Control to the VS Toolbox. For a brief introduction to TCI you can check the VS SDK documentation. Here I will try to cover what is happening under cover:  &lt;p&gt;When you want to add your custom control to the VS toolbox using the TCI VS Package all you need is to tell TCI where the assembly containing the control is and&amp;nbsp;notify&amp;nbsp;to TCI this event incrementing a registry key.&amp;nbsp;Probably the easier way to achieve these requirements is using a WIX-based installer (as the SDK sample does).  &lt;p&gt;In order to tell TCI where your control is&amp;nbsp;you can&amp;nbsp;use the&amp;nbsp;the fully qualified type name if you are installing the control in the GAC as following:  &lt;p&gt;&amp;lt;Registry Root="HKLM" Key="Software\Microsoft\VisualStudio\9.0\ToolboxControlsInstaller\GacControl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1631b3e7a8fbcce5, processorArchitecture=MSIL" Value="Litware Controls" Type="string" /&amp;gt;  &lt;p&gt;Or provide a location where the assembly containing the control&amp;nbsp;is using the CodeBase value:  &lt;p&gt;&amp;lt;Registry Root="HKLM" Key="Software\Microsoft\VisualStudio\9.0\ToolboxControlsInstaller\NonGacControl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1631b3e7a8fbcce5, processorArchitecture=MSIL" Value="Litware Controls" Type="string"&amp;gt;&lt;br&gt;&amp;lt;Registry Name="Codebase" Value="[#AssemblyContainingTheFile.dll]" Type="string" /&amp;gt;&lt;br&gt;&amp;lt;/Registry&amp;gt;  &lt;p&gt;Finally you have to include the MSM containing the custom actions which notify TCI that a new Control has been installed:  &lt;p&gt;&amp;lt;Merge Id="TbxCtrlsInstDefaultItemsCA" Language="1033" SourceFile="..\..\..\Redistributables\TbxCtrlsInstDefaultItemsCA.msm" DiskId="1" /&amp;gt;  &lt;p&gt;The custom action will increment or decrement the&amp;nbsp;"Default Items" value of the&amp;nbsp;following registry entry:  &lt;p&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\{2c298b35-07da-45f1-96a3-be55d91c8d7a}\Toolbox]&lt;br&gt;"Default Items"=dword:00000001  &lt;p&gt;Note that&amp;nbsp;the&amp;nbsp;{2c298b35-07da-45f1-96a3-be55d91c8d7a} is the GUID for the TCI VS Package.  &lt;p&gt;It's important to check if the TCI Redist is already installed before installing your custom controls if you targeting VS 2500. It's not necessary for VS codename "Orcas" because&amp;nbsp;TCI Package is already installed. You can find the TCI VS Package in the VS's Private Assemblies directory.&amp;nbsp;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-4545503440536581135?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/4545503440536581135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=4545503440536581135' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4545503440536581135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4545503440536581135'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/09/tci-toolbox-controls-installer.html' title='TCI - Toolbox Controls Installer'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-2364474867243010207</id><published>2007-08-27T11:41:00.001-07:00</published><updated>2007-08-27T11:41:27.420-07:00</updated><title type='text'>Why a good error message is important</title><content type='html'>&lt;p&gt;I was trying to change my private email in one of the forums I'm subscripted. The thing is that after clicking the save button it said:&lt;/p&gt; &lt;p&gt;&lt;em&gt;"Sorry, an Error has Occurred"&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;"Unfortunately an error has occurred during the processing of your page request. If&amp;nbsp;you were attempting to submit a new post, your post may not have been recorded. Please accept our apologies for the inconvenience."&lt;/em&gt;&lt;/p&gt; &lt;p&gt;And some links to go back, help, etc.&amp;nbsp;No helpful at all. I searched through the forum posts to find out if someone had has the same issue and I found that the private email address&amp;nbsp;couldn't be duplicated. In that moment I remembered I had another user with that address so I could take the steps to be able to change&amp;nbsp;it in a few seconds. If the error message had been something like "The email address is being used by another user. Please choose a different mail and try again" it would be a significant save of time. &lt;/p&gt; &lt;p&gt;The cause of the error is probably&amp;nbsp;due to&amp;nbsp;they are not&amp;nbsp;validating the email address, so after receiving the generic sql error they show the generic (not useful at all) "Sorry, and Error has Occurred".&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-2364474867243010207?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/2364474867243010207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=2364474867243010207' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2364474867243010207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2364474867243010207'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/08/why-good-error-message-is-important.html' title='Why a good error message is important'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-6501706852860372237</id><published>2007-08-15T18:56:00.001-07:00</published><updated>2007-08-15T18:57:39.995-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS Extensibility'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>"Organize Usings" in VS code name "Orcas" ala Eclipse</title><content type='html'>&lt;p&gt;Those that have used Eclipse will probably miss the ctrl+shift+o shortcut ("Organize Imports") when you switch to VS. But now VS code name "Orcas"&amp;nbsp;provides a "new" feature (which&amp;nbsp;unofficially existed in Whidbey)&amp;nbsp;that allows you to remove and sort usings:&lt;/p&gt; &lt;p&gt;&lt;img src="http://blog-adrianalonso.certant.com/blog/sortandremove01.JPG"&gt; &lt;/p&gt; &lt;p&gt;So if you don't want miss the Eclipse feature anymore you can add the shortcut going to Tools-&amp;gt;Options-&amp;gt;Environment-&amp;gt;Keyboard&lt;/p&gt; &lt;p&gt;&lt;img src="http://blog-adrianalonso.certant.com/blog/sortandremove02.JPG"&gt; &lt;/p&gt; &lt;p&gt;Search the RemoveAndSort command and press the ctrl+shift+o combination. Note that the shorcut is&amp;nbsp;currently used by the OpenProject command and it will lost if&amp;nbsp;you&amp;nbsp;confirm to use the combination&amp;nbsp;for the RemoveAndSort command.&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-6501706852860372237?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/6501706852860372237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=6501706852860372237' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6501706852860372237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6501706852860372237'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/08/usings-in-vs-code-name-ala-eclipse.html' title='&amp;quot;Organize Usings&amp;quot; in VS code name &amp;quot;Orcas&amp;quot; ala Eclipse'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-1842271591319454074</id><published>2007-08-05T19:01:00.001-07:00</published><updated>2007-08-05T19:18:21.564-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS Extensibility'/><category scheme='http://www.blogger.com/atom/ns#' term='GAX/GAT'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>GAX 1.3 is out!</title><content type='html'>&lt;p&gt;This new version of GAX is a must if you are thinking to develop Guidance Packages&amp;nbsp;using&amp;nbsp;VS Codename "Orcas" (previous version of GAX didn't work&amp;nbsp;with the latest version of VS) and it will also provide some new features if your are developing with VS 2005.&lt;/p&gt; &lt;p&gt;A&amp;nbsp;welcomed “fix” is the&amp;nbsp;enhancement of the&amp;nbsp;registration process. Now it's&amp;nbsp;smarter&amp;nbsp;about&amp;nbsp;whether to install VB templates&amp;nbsp;based on the presence of VB as a Visual Studio's product.&amp;nbsp;This means that&amp;nbsp;if your Guidance Package contains VB templates (.vstemplates for VB projects or items) you won't need to&amp;nbsp;add conditional logic in your installer to avoid the registration failure when the package is being installed or registered.  &lt;p&gt;The GAX installer is also improved to use WIX technology but&amp;nbsp;the GAT installer project that is unfolded when you create a new Guidance Package using GAT is still the same VS Setup Project. &lt;p&gt;At last, the Experimental Hive registration is now a built-in feature in GAX allowing you to register your Guidance Packages in both Normal and Experimental hives.  &lt;p&gt;So it seems that this CTP is a&amp;nbsp;necessary and welcomed&amp;nbsp;update&amp;nbsp;for the runtime but not for the UX of developing Guidance Packages.  &lt;p&gt;Here you have the links: &lt;p&gt;- &lt;a href="http://blogs.msdn.com/agile/archive/2007/08/02/new-gax-gat-july-2007-released.aspx"&gt;Grigory Melnik's announcement&lt;/a&gt;&lt;br&gt;- &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C0A394C0-5EEB-47C4-9F7B-71E51866A7ED&amp;amp;displaylang=en"&gt;GAX July 2007 CTP download&lt;/a&gt;&lt;br&gt;- &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=E3D101DB-6EE1-4EC5-884E-97B27E49EAAE&amp;amp;displaylang=en"&gt;GAT July 2007 CTP&amp;nbsp;download&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-1842271591319454074?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/1842271591319454074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=1842271591319454074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/1842271591319454074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/1842271591319454074'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/08/gax-13-is-out.html' title='GAX 1.3 is out!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-3235728931149634909</id><published>2007-08-01T15:51:00.001-07:00</published><updated>2007-08-01T15:55:28.798-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Volta'/><title type='text'>Microsoft Volta</title><content type='html'>&lt;p&gt;What&amp;nbsp;Microsoft Volta is? Take a look at these videos in &lt;a href="http://channel9.msdn.com/"&gt;channel 9&lt;/a&gt;:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;1. &lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=324060"&gt;Eirk Meijer: Volta - Wrapping the Cloud with .NET - Part 1&lt;/a&gt;&lt;br&gt;2. &lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=324699"&gt;Eirk Meijer: Volta - Wrapping the Cloud with .NET - Part 2&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;From the video introduction:&lt;/p&gt; &lt;p&gt;&lt;em&gt;"Volta is an evolving research project focused on exploring ways to innovate data-intensive programming models. Volta is currently exploring a lean-programming inspired toolkit for building web-based and mobile applications by stretching the .NET programming model to cover the Cloud. &lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Volta is exploring innovation that empowers programmers to delay decisions about tier-splitting to the last possible responsible moment by using either code refactoring or declarative annotations. "&lt;/em&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-3235728931149634909?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/3235728931149634909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=3235728931149634909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/3235728931149634909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/3235728931149634909'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/08/microsoft-volta.html' title='Microsoft Volta'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-2976192217752802805</id><published>2007-06-07T06:27:00.001-07:00</published><updated>2007-06-07T06:31:41.748-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='SFT'/><title type='text'>SFT Setup Project: Deploying many Guidance Packages and many DSLs with a single MSI!</title><content type='html'>&lt;p&gt;&lt;a href="http://www.softwarefactoriestoolkit.net/"&gt;Clarius SFT June CTP&lt;/a&gt;&amp;nbsp;is available. You can check &lt;a href="http://www.clariusconsulting.net/blogs/vga"&gt;Victor's blog&lt;/a&gt;&amp;nbsp;in order to get an overview of&amp;nbsp;the new features included in this drop. One of this new features is the capability of creating a Setup Project to generate a single MSI that installs many Guidance Packages and many DSLs. Let's take a look at how this feature works:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SFT Setup Project Feature:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This new feature allows you to create a new C# or VB wix-based&amp;nbsp;project selecting which Guidance Packages or DSLs you want to include in your&amp;nbsp;MSI. After running the wizard you will get a single project&amp;nbsp;whose output&amp;nbsp;will be&amp;nbsp;a single MSI.&lt;/p&gt; &lt;p&gt;&lt;em&gt;Here is an example:&lt;/em&gt;&lt;/p&gt; &lt;p&gt;1. In this sample we have a&amp;nbsp;solution that contains the following projects: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;a. A class diagram DSL project&lt;br&gt;b.&amp;nbsp;A minimal language DSL project&lt;br&gt;c.&amp;nbsp;A GAT-based Guidance Package&lt;br&gt;d. A SFT-based Guidance Package&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The SFT Setup Project wizard is launched adding a new project to the solution. You can select between C# and VB project types. &lt;/p&gt; &lt;p&gt;&lt;img src="http://blog-adrianalonso.certant.com/blog/sftsetupproject01.jpg"&gt; &lt;/p&gt; &lt;p&gt;2. The wizard is very simple. You just need to select the guidance packages and DSLs that will be included in the MSI and click finish.&lt;/p&gt; &lt;p&gt;&lt;img src="http://blog-adrianalonso.certant.com/blog/sftsetupproject02.JPG"&gt; &lt;/p&gt; &lt;p&gt;3. Finally a new project will be added to the solution. At this point you should be able to build the project in order to get the MSI.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;img src="http://blog-adrianalonso.certant.com/blog/sftsetupproject03.JPG"&gt; &lt;/p&gt; &lt;p&gt;Basically&amp;nbsp;you will find&amp;nbsp;3 groups of files in the SFT Setup Project:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;1. Main Setup files&lt;br&gt;2. Guidance Packages files: Containg a few files by Guidance Package. You can take a look at my previous post&amp;nbsp;showing how&amp;nbsp;each Guidance Package setup is generated.&amp;nbsp;&lt;br&gt;3. DSLs files:&amp;nbsp;Each DSL setup is generated in the same way&amp;nbsp;as the DSL Setup Project provided by the DSL SDK does. We chose this implementation&amp;nbsp;because if you&amp;nbsp;already know how to customize the DSL Setup Project you won't need to expend time understanding this new feature of SFT!&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;(1)&amp;nbsp;Main Setup Files:&lt;br&gt;&lt;/strong&gt;&lt;strong&gt;SetupMetadata.items:&lt;/strong&gt; This is the file where you can customize the metadata for Guidance Packages, DSLs and define&amp;nbsp;the projects that will be built before&amp;nbsp;generating the MSI.&amp;nbsp;&lt;br&gt;&lt;strong&gt;Setup.wxs:&lt;/strong&gt; This is probably the most important file because it contains the setup product definition, the directory tree structure, the features (or the feature references), custom actions and the UI definition.&lt;br&gt;&lt;strong&gt;UI.wxs:&lt;/strong&gt; This contains the UI definition. This is probably the main file you will&amp;nbsp;need to customize to include your own branding.&lt;br&gt;&lt;strong&gt;Strings.wxl:&lt;/strong&gt; Wix localization stuff file.&lt;br&gt;&lt;strong&gt;License\License.rtf:&lt;/strong&gt; The license file&amp;nbsp;for your Guidance Package.&lt;br&gt;&lt;strong&gt;Bitmaps Folder:&lt;/strong&gt; Image files&amp;nbsp;for the installer wizard branding.&lt;/p&gt; &lt;p&gt;Where to&amp;nbsp;download SFT?&amp;nbsp;Follow this link! &amp;nbsp;&lt;a title="http://www.softwarefactoriestoolkit.net/" href="http://www.softwarefactoriestoolkit.net/"&gt;http://www.softwarefactoriestoolkit.net/&lt;/a&gt;&lt;br&gt;And please let us know your feedback about you want to include&amp;nbsp;or&amp;nbsp;improve in the next drops!&amp;nbsp;You can ping us&amp;nbsp;through the &lt;a href="http://www.guidanceautomation.net/cs/forums/"&gt;Guidance Automation Forum&lt;/a&gt; or directly to alo -AT- clariusconsulting -DOT- net.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-2976192217752802805?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/2976192217752802805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=2976192217752802805' title='44 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2976192217752802805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2976192217752802805'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/06/sft-setup-project-deploying-many.html' title='SFT Setup Project: Deploying many Guidance Packages and many DSLs with a single MSI!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>44</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-2281623718051179888</id><published>2007-04-10T19:18:00.001-07:00</published><updated>2007-04-10T19:20:35.313-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Entlib'/><title type='text'>HowTo: Application Block Software Factory (ABSF) Part III: An example</title><content type='html'>&lt;p&gt;After an &lt;a href="http://adrianalonso.blogspot.com/2007/02/howto-application-block-software.html"&gt;introduction&lt;/a&gt; to ABSF and a explanation about &lt;a href="http://adrianalonso.blogspot.com/2007/03/howto-application-block-software.html"&gt;providers&lt;/a&gt;, here you have an example of how an application block and a provider library&amp;nbsp;can be&amp;nbsp;created. What I did was to take snapshots of the solution after executing each recipe:&lt;/p&gt; &lt;p&gt;1. New Animal Application Block&lt;br&gt;2. New Provider Factory and Base 'Animal'&lt;br&gt;3. New Provider (Typed) 'Dog'&lt;br&gt;4. New Provider (Untyped) 'Monkey'&lt;br&gt;5. New Design-Time Base Provider Node 'AnimalNode'&lt;br&gt;6. New Design-Time Provider Node 'DogNode'&lt;br&gt;7. New Provider Library&lt;br&gt;8. New Provider (Typed) 'Cat'&lt;br&gt;9. New Design-Time Provider Node 'CatNode'&lt;/p&gt; &lt;p&gt;The example is based on the Animal Application Block of &lt;a href="http://www.agileprogrammer.com/oneagilecoder/"&gt;Brian Button&lt;/a&gt;. Brian and &lt;a href="http://blogs.msdn.com/tomholl"&gt;Tom&lt;/a&gt; did a series of&amp;nbsp;webcasts explaining the Entlib Core and Design-Time&amp;nbsp;creating an Animal Application Block. You can download the&amp;nbsp;webcasts from &lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032289570&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;here&lt;/a&gt; and &lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032291157&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The idea is that you can open each snapshot and take a look at what stuff is created after executing each recipe. In order to build the snapshots, you will have to copy the Common.dll, Configuration.Design.dll and ObjectBuilder.dll to the lib folder of each snapshot. I recommend you to unzip the snapshots in a directory near the root (c:\) because of the&amp;nbsp;path length restriction (you won't be able to build the snapshots&amp;nbsp;if the path is longer than 248 characters)&amp;nbsp;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Finally here you have the link to the&amp;nbsp;&lt;a href="http://blog-adrianalonso.certant.com/blog/Animal Application Block and Library.zip"&gt;snapshots&lt;/a&gt;!&lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-2281623718051179888?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/2281623718051179888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=2281623718051179888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2281623718051179888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2281623718051179888'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/04/howto-application-block-software.html' title='HowTo: Application Block Software Factory (ABSF) Part III: An example'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-8473577793844552534</id><published>2007-04-06T08:39:00.001-07:00</published><updated>2007-04-06T08:40:58.123-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Entlib'/><title type='text'>Enterprise Library 3.0 Released!</title><content type='html'>&lt;p&gt;I've been part of this&amp;nbsp;excited project mostly developing the Application Block Software Factory (ABSF) and some parts of the Validation Application Block (VAB) (which core and intergation support&amp;nbsp;was developed by &lt;a href="http://www.clariusconsulting.net/blogs/fds"&gt;Fernando&lt;/a&gt;). I want to thanks all to let me be part of this great experience and learn&amp;nbsp;a lot from this spectacular people.&amp;nbsp;&lt;/p&gt; &lt;p&gt;You can download it, start using it and provide feedback! Here you have the links:&lt;/p&gt; &lt;p&gt;Download: &lt;a title="http://www.microsoft.com/downloads/details.aspx?FamilyID=62ef5f79-daf2-43af-9897-d926f03b9e60&amp;amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=62ef5f79-daf2-43af-9897-d926f03b9e60&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=62ef5f79-daf2-43af-9897-d926f03b9e60&amp;amp;displaylang=en&lt;/a&gt;&lt;br&gt;Codeplex community site: &lt;a title="http://www.codeplex.com/entlib" href="http://www.codeplex.com/entlib"&gt;http://www.codeplex.com/entlib&lt;/a&gt;&lt;br&gt;Tom Hollander's Blog: &lt;a title="http://blogs.msdn.com/tomholl/" href="http://blogs.msdn.com/tomholl/"&gt;http://blogs.msdn.com/tomholl/&lt;/a&gt;&lt;br&gt;Olaf's Blog: &lt;a href="http://bloggingabout.net/blogs/olaf"&gt;http://bloggingabout.net/blogs/olaf&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-8473577793844552534?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/8473577793844552534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=8473577793844552534' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/8473577793844552534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/8473577793844552534'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/04/enterprise-library-30-released.html' title='Enterprise Library 3.0 Released!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-4303246876121542561</id><published>2007-04-04T16:04:00.001-07:00</published><updated>2007-04-04T16:34:02.081-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS Extensibility'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>.Net Generic Finder (VS Automation Model Usage)</title><content type='html'>&lt;p&gt;I know there are Find/FindAll methods in&amp;nbsp;the System.Collection.* namespace but what I was looking for is something quite different. Here is more&amp;nbsp;or less&amp;nbsp;the scenario:&lt;/p&gt; &lt;p&gt;Suppose you have objects&amp;nbsp;that can be any of the following interfaces: Solution (S), Project (P)&amp;nbsp;or ProjectItem (PI). You don't have a common super type to treat all as&amp;nbsp;polymorphic objects.&amp;nbsp;So if you have a collection of them (Objects)&amp;nbsp;you are not able to have&amp;nbsp;Collection&amp;lt;T&amp;gt; where T is { S | P | PI } because you could have a mix of them (of course at least you have a Collection&amp;lt;Object&amp;gt; but in this&amp;nbsp;case we would not need Generics anyway).&lt;/p&gt; &lt;p&gt;I wanted a finder that allows me to search for an object in&amp;nbsp;this object&amp;nbsp;collection but using the benefits of Generics. I wanted to use&amp;nbsp;the most abstract representation of a collection I could have and I decided to use an IEnumerable parameter. Then I needed to define a Predicate&amp;lt;T&amp;gt; and&amp;nbsp;what I am going to&amp;nbsp;expect is&amp;nbsp;a T or&amp;nbsp;IEnumerable&amp;lt;T&amp;gt;&amp;nbsp;result.&lt;/p&gt; &lt;p&gt;For example:&amp;nbsp;If the&amp;nbsp;&lt;strong&gt;col&lt;/strong&gt; is&amp;nbsp;= {&amp;nbsp;S1, P1,&amp;nbsp;P2, P3, PI1, PI2, PI3 }&lt;/p&gt; &lt;p&gt;The following tests should pass:&lt;/p&gt; &lt;p&gt;1.&amp;nbsp;Finder.FindAll&amp;lt;&lt;strong&gt;Solution&lt;/strong&gt;&amp;gt;(&lt;strong&gt;col&lt;/strong&gt;, delegate( return Predicates.&lt;em&gt;GetNullPredicate&lt;/em&gt;&amp;lt;T&amp;gt;())) &lt;strong&gt;contains&lt;/strong&gt; {&lt;em&gt;S1&lt;/em&gt;}&lt;br&gt;2.&amp;nbsp;Finder.FindAll&amp;lt;&lt;strong&gt;Project&lt;/strong&gt;&amp;gt;(&lt;strong&gt;col&lt;/strong&gt;, delegate( return Predicates.&lt;em&gt;GetNullPredicate&lt;/em&gt;&amp;lt;T&amp;gt;())) &lt;strong&gt;contains&lt;/strong&gt; {&lt;em&gt;P1, P2, P3&lt;/em&gt;}&lt;br&gt;3.&amp;nbsp;Finder.FindAll&amp;lt;&lt;strong&gt;ProjectItem&lt;/strong&gt;&amp;gt;(&lt;strong&gt;col&lt;/strong&gt;, delegate( return Predicates.&lt;em&gt;GetNullPredicate&lt;/em&gt;&amp;lt;T&amp;gt;())) &lt;strong&gt;contains&lt;/strong&gt; {&lt;em&gt;PI1, PI2, PI3&lt;/em&gt;}&lt;/p&gt; &lt;p&gt;So I am&amp;nbsp;able to&amp;nbsp;get a IEnumerable&amp;lt;T&amp;gt; where T is { S | P | PI }. I could also specify&amp;nbsp;any other&amp;nbsp;predicate to&amp;nbsp;evaluate specific properties of each T. Notice that I am using the Predicates.Is&amp;lt;T&amp;gt; helper method I published in my &lt;a href="http://adrianalonso.blogspot.com/2007/04/andoris-predicates.html"&gt;previous post&lt;/a&gt; to validate if the predicate can be evaluated. I am also using the &lt;strong&gt;yield&lt;/strong&gt; support to collect the result.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Finder&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; T Find&amp;lt;T&amp;gt;(IEnumerable elements, Predicate&amp;lt;T&amp;gt; predicate) &lt;span class="kwrd"&gt;where&lt;/span&gt; T : &lt;span class="kwrd"&gt;class&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        IEnumerator&amp;lt;T&amp;gt; enumerator = Find(elements, predicate, &lt;span class="kwrd"&gt;true&lt;/span&gt;).GetEnumerator();&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; enumerator.MoveNext() ? enumerator.Current : &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; IEnumerable&amp;lt;T&amp;gt; FindAll&amp;lt;T&amp;gt;(IEnumerable elements, Predicate&amp;lt;T&amp;gt; predicate) &lt;span class="kwrd"&gt;where&lt;/span&gt; T : &lt;span class="kwrd"&gt;class&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; Find&amp;lt;T&amp;gt;(elements, predicate, &lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; IEnumerable&amp;lt;T&amp;gt; Find&amp;lt;T&amp;gt;(IEnumerable elements, Predicate&amp;lt;T&amp;gt; predicate, &lt;span class="kwrd"&gt;bool&lt;/span&gt; returnFirst) &lt;span class="kwrd"&gt;where&lt;/span&gt; T : &lt;span class="kwrd"&gt;class&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; != elements)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (&lt;span class="kwrd"&gt;object&lt;/span&gt; element &lt;span class="kwrd"&gt;in&lt;/span&gt; elements)&lt;br /&gt;            {&lt;br /&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; (Predicates.Is&amp;lt;T&amp;gt;(element, predicate))&lt;br /&gt;                {&lt;br /&gt;                    &lt;span class="kwrd"&gt;yield&lt;/span&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; (T)element;&lt;br /&gt;                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (returnFirst) &lt;span class="kwrd"&gt;yield&lt;/span&gt; &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="kwrd"&gt;yield&lt;/span&gt; &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-4303246876121542561?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/4303246876121542561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=4303246876121542561' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4303246876121542561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4303246876121542561'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/04/net-generic-finder-vs-automation-model.html' title='.Net Generic Finder (VS Automation Model Usage)'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-7347730454896444877</id><published>2007-04-04T15:20:00.001-07:00</published><updated>2007-04-04T16:33:37.885-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>And/Or/Is Predicates</title><content type='html'>&lt;p&gt;The .Net fx doesn't have any support to compose Predicates so I decided to create a Predicates helper for a small project I was working on the last weeks. Here you have my composite&amp;nbsp;predicate methods:&lt;/p&gt;&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Predicates&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Predicate&amp;lt;T&amp;gt; And&amp;lt;T&amp;gt;(Predicate&amp;lt;T&amp;gt; predicate, Predicate&amp;lt;T&amp;gt; anotherPredicate)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;delegate&lt;/span&gt;(T t) { &lt;span class="kwrd"&gt;return&lt;/span&gt; predicate(t) &amp;amp;&amp;amp; anotherPredicate(t); };&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Predicate&amp;lt;T&amp;gt; Or&amp;lt;T&amp;gt;(Predicate&amp;lt;T&amp;gt; predicate, Predicate&amp;lt;T&amp;gt; anotherPredicate)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;delegate&lt;/span&gt;(T t) { &lt;span class="kwrd"&gt;return&lt;/span&gt; predicate(t) || anotherPredicate(t); };&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Is&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;object&lt;/span&gt; target, Predicate&amp;lt;T&amp;gt; predicate) &lt;span class="kwrd"&gt;where&lt;/span&gt; T : &lt;span class="kwrd"&gt;class&lt;/span&gt;&lt;br /&gt;        {&lt;br /&gt;            T targetAsT = target &lt;span class="kwrd"&gt;as&lt;/span&gt; T;&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; ( &lt;span class="kwrd"&gt;null&lt;/span&gt; != targetAsT  )&lt;br /&gt;            {&lt;br /&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; predicate(targetAsT);&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Predicate&amp;lt;T&amp;gt; GetNullPredicate&amp;lt;T&amp;gt;()&lt;br /&gt;        {&lt;br /&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;delegate&lt;/span&gt;(T t) { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;; }; &lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The Is&amp;lt;T&amp;gt; method allows you to validate if the target object is of T type before evaluating the predicate. This is something I found very useful when I am working with VS Automation Model because there are "Objects" that can implement many many interfaces so you have a collection of those objects that may or not target the T type. I will publish another post with a Finder example.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&amp;nbsp;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-7347730454896444877?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/7347730454896444877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=7347730454896444877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/7347730454896444877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/7347730454896444877'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/04/andoris-predicates.html' title='And/Or/Is Predicates'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-8541242388288424339</id><published>2007-03-24T06:07:00.001-07:00</published><updated>2007-03-24T06:10:09.777-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>Bela Fleck &amp; the Fleckstones @ Argentina! (or it could has been Victor Wooten &amp; the Wootenstones)</title><content type='html'>&lt;p&gt;Yesterday &lt;a href="http://www.flecktones.com/site.php"&gt;Bela Feck &amp;amp; the Fleckstones&lt;/a&gt;&amp;nbsp;presented @ Argentina with a spectacular&amp;nbsp;show. I listened and saw one of the most spectacular bass player performance ever seen performed&amp;nbsp;by &lt;a href="http://www.victorwooten.com/"&gt;Victor Lemonte Wooten&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="http://blog-adrianalonso.certant.com/blog/victorwooten.jpg"&gt; &lt;/p&gt; &lt;p&gt;If you&amp;nbsp;enjoy listening&amp;nbsp;or playing the bass guitar (in all its forms: tapping, slapping/poping, fingering, etc etc etc etc) this guy is someone you must know and listen to!&amp;nbsp;&lt;/p&gt; &lt;p&gt;By far, Victor was the&amp;nbsp;most&amp;nbsp;applauded artist in the shown so in that moment you don't know if the band should be called "Bela Fleck &amp;amp; the Fleckstones" or "Victor Wooten &amp;amp; the Wootenstones"!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-8541242388288424339?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/8541242388288424339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=8541242388288424339' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/8541242388288424339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/8541242388288424339'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/03/bela-fleck-fleckstones-argentina-or-it.html' title='Bela Fleck &amp;amp; the Fleckstones @ Argentina! (or it could has been Victor Wooten &amp;amp; the Wootenstones)'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-6918235886936910926</id><published>2007-03-21T19:37:00.001-07:00</published><updated>2007-03-22T06:49:42.465-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='SFT'/><title type='text'>Clarius SFT - Wix-based Setup Projects</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;One of the features SFT provides is&amp;nbsp;support for&amp;nbsp;Wix-based Setup projects. I&amp;nbsp;will show how you can use and extend it to generate a&amp;nbsp;MSI for your guidance package.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Wix-based Setup&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;When you are creating a Guidance Package with SFT, you can&amp;nbsp;choose to&amp;nbsp;create a VS Setup Project or a Wix-based one as is shown in the following picture:&lt;/p&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;img src="http://blog-adrianalonso.certant.com/blog/sft.JPG"&gt; &lt;/font&gt;&lt;/p&gt; &lt;p&gt;If you select the Wix-based option, the preview setup&amp;nbsp;project will be unfolded in your solution.Let's take a look at the files that are generated by the wizard:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Setup.wxs:&lt;/strong&gt; This is probably the most important file because it contains the setup product definition, the directory tree structure, the features (or the feature references), the custom actions for registering the guidance package and the UI definition.&lt;br&gt;&lt;strong&gt;TemplatesContent.wxs/TemplateFeature.wxs:&lt;/strong&gt; Both files&amp;nbsp;are dynamic, this means that their content of&amp;nbsp;these files will be updated&amp;nbsp;&amp;nbsp;every time you build the Setup Project. They will included every file inside&amp;nbsp;any folder in the guidance package project&amp;nbsp;output directory.&amp;nbsp;&lt;br&gt;&lt;strong&gt;UI.wxs:&lt;/strong&gt; This contains the UI definition. This is probably the main file you will&amp;nbsp;need to customize to include your own branding.&lt;br&gt;&lt;strong&gt;Strings.wxl:&lt;/strong&gt; Wix localization stuff file.&lt;br&gt;&lt;strong&gt;MySoftwareFactoryInstaller.config.xml:&lt;/strong&gt; Guidance Package configuration file. For instance here&amp;nbsp;you can specify here the supported runtime version.&lt;br&gt;&lt;strong&gt;License\License.rtf:&lt;/strong&gt; The license file&amp;nbsp;for your Guidance Package.&lt;br&gt;&lt;strong&gt;Bitmaps Folder:&lt;/strong&gt; Image files&amp;nbsp;for the installer wizard branding.&lt;/p&gt; &lt;p&gt;&lt;em&gt;How it works:&lt;/em&gt;&lt;/p&gt; &lt;p&gt;The SFT Wix-based project is&amp;nbsp;a standard C# or VB&amp;nbsp;project (depending on what language you choose when you are creating a new MetaFactory solution).&amp;nbsp;It defines the AfterBuild/AfterRebuild targets and&amp;nbsp;the following import:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Import&lt;/span&gt; &lt;span class="attr"&gt;Project&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildExtensionsPath)\Clarius Consulting\Software Factories Toolkit\1.0\MetaFactory\wix.targets"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The wix.targets file contains the necessary targets to compile (Candle) and link (Light) your wix files in order to generate a MSI for your guidance package. Before that, the WixRefreshContent target is responsible for scanning all the directories in the output folder and updating the content of the TemplatesContent.wxs/TemplatesFeature files. &lt;br /&gt;&lt;p&gt;&lt;em&gt;Customizing the Wix-based Setup Project:&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are some scenarios where you may want to customize the code that the SFT wizard generates&amp;nbsp;for you. The most common scenarios&amp;nbsp;could include:&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Changing the UI branding: You can&amp;nbsp;modify the images in the Bitmaps folder by&amp;nbsp;just overwriting them. You can also&amp;nbsp;customize the Dialogs order, descriptions, colors, etc just editing the&amp;nbsp;UI.wxs or Strings.wxl files. &lt;br /&gt;&lt;li&gt;Adding dependencies: If you need to&amp;nbsp;include more than the Guidance Package and Guidance Package Installer assemblies, you can add them in the Setup.wxs file just adding a &amp;lt;File&amp;gt; element inside an existing directory&amp;nbsp;or you could even create&amp;nbsp;your own new&amp;nbsp;directory structure.&amp;nbsp; &lt;br /&gt;&lt;li&gt;Launch Conditions: If you Guidance Package will relies on some&amp;nbsp;other software components that must be installed in the target machine, you can add Wix Launch Conditions in the Setup.wxs file.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;I hope this post help you to understand the SFT Wix-based Setup Project structure, how it works and how&amp;nbsp;you can easily customize it with a&amp;nbsp;low effort. If you have any questions about this or other features in SFT you can visit the following sites/forums:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Guidance Automation.Net: &lt;a href="http://www.guidanceautomation.net"&gt;http://www.guidanceautomation.net&lt;/a&gt;&lt;br&gt;SFT: &lt;a title="http://www.softwarefactoriestoolkit.com/" href="http://www.softwarefactoriestoolkit.com/"&gt;http://www.softwarefactoriestoolkit.com/&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Enjoy!&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-6918235886936910926?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/6918235886936910926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=6918235886936910926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6918235886936910926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6918235886936910926'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/03/clarius-sft-wix-based-setup-projects.html' title='Clarius SFT - Wix-based Setup Projects'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-6992301931158304451</id><published>2007-03-21T14:07:00.001-07:00</published><updated>2007-03-21T19:41:10.201-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='SFT'/><title type='text'>Clarius Software Factories Toolkit (SFT) February 2007 CTP is out!!</title><content type='html'>&lt;p&gt;Clarius SFT Feb 2007 CTP is finally out!&lt;/p&gt; &lt;p&gt;The new release includes several&amp;nbsp;new features and improvements. &lt;a href="http://latincoder.com/cs2/blogs/jes/archive/2007/03/21/Clarius-Software-Factory-Toolkit-February-2007-CTP-is-out_2E00_.aspx"&gt;Jes&lt;/a&gt; has published a very interesting post describing some of them. You can also visit the SFT &lt;a href="http://softwarefactoriestoolkit.net/"&gt;website&lt;/a&gt; to take a look at the latest &lt;a href="http://softwarefactoriestoolkit.net/videos.aspx"&gt;videos&lt;/a&gt;, &lt;a href="http://softwarefactoriestoolkit.net/default.aspx"&gt;news&lt;/a&gt;, &lt;a href="http://softwarefactoriestoolkit.net/downloads.aspx"&gt;documentation&lt;/a&gt;, &lt;a href="http://softwarefactoriestoolkit.net/support.aspx"&gt;support&lt;/a&gt; and &lt;a href="http://softwarefactoriestoolkit.net/downloads.aspx"&gt;download it&lt;/a&gt;!&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Some useful&amp;nbsp;links:&lt;br&gt;&lt;/strong&gt;SFT Home Page: &lt;a href="http://softwarefactoriestoolkit.net"&gt;http://softwarefactoriestoolkit.net&lt;/a&gt;&lt;br&gt;Support: &lt;a href="http://softwarefactoriestoolkit.net/support.aspx"&gt;http://softwarefactoriestoolkit.net/support.aspx&lt;/a&gt;&lt;br&gt;Download: &lt;a href="http://softwarefactoriestoolkit.net/Download_Feb07CTP.aspx"&gt;http://softwarefactoriestoolkit.net/Download_Feb07CTP.aspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-6992301931158304451?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/6992301931158304451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=6992301931158304451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6992301931158304451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6992301931158304451'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/03/clarius-software-factories-toolkit-sft.html' title='Clarius Software Factories Toolkit (SFT) February 2007 CTP is out!!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-6235442737030717300</id><published>2007-03-20T13:48:00.001-07:00</published><updated>2007-03-20T13:51:39.256-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Conferences'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Windows Workflow Foundation @ MS Argentina</title><content type='html'>&lt;p&gt;&lt;a href="http://solepano.blogspot.com/"&gt;Sole&lt;/a&gt; will be taking part of the "Introduction to Windows Workflow Foundation" conference&amp;nbsp;jointly with Diego Gonzalez and Jorge Fioranelli. You can check the detailed event information in&amp;nbsp;&lt;a href="http://solepano.blogspot.com/"&gt;Sole's blog&lt;/a&gt;. Here is the&amp;nbsp;event summary:&lt;/p&gt; &lt;p&gt;When? &lt;strong&gt;April 12 from 9 to 13&lt;br&gt;&lt;/strong&gt;Where? &lt;strong&gt;Bouchard 710, 4 piso,&amp;nbsp; Buenos Aires, Argentina&lt;br&gt;&lt;/strong&gt;How to sign up? Follow this &lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032334436&amp;amp;Culture=es-AR"&gt;link&lt;/a&gt;&lt;br&gt;What is it about?&lt;/p&gt; &lt;p&gt;&lt;em&gt;“Between the new technologies included in the recently released .Net Framework 3.0, we found Windows Workflow Foundation, which consists on the most innovating tool set included in this new framework’s version. The possibility of extracting the workflow concept from the applications as a reusable and extensible element is an extremely innovating aspect in terms of application design. Tools are also included that let you visually edit workflows, enabling analysts and users without programming knowledge to extend applications with a minimum impact in the whole application.&lt;/em&gt; &lt;p&gt;&lt;em&gt;The conference will consist on an introduction to the technology, showing its main characteristics, a demonstration of its more relevant advanced aspects, and will end with two examples of real projects where Windows Workflow Foundation has been used in combination with other technologies to solve common issues.”&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-6235442737030717300?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/6235442737030717300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=6235442737030717300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6235442737030717300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6235442737030717300'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/03/windows-workflow-foundation-ms.html' title='Windows Workflow Foundation @ MS Argentina'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-4926512509377223774</id><published>2007-03-20T11:36:00.001-07:00</published><updated>2007-03-20T13:51:13.078-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Entlib'/><title type='text'>HowTo: Application Block Software Factory (ABSF) Part II: Providers</title><content type='html'>&lt;p&gt;This is the second part of this &lt;a href="http://adrianalonso.blogspot.com/2007/02/howto-application-block-software.html"&gt;post&lt;/a&gt;.&amp;nbsp;In this one I&amp;nbsp;will tell you what you need to know when you are creating a&amp;nbsp;new Provider (Typed or Untyped).&lt;/p&gt; &lt;p&gt;When you are creating a new provider for your own block you will have to specify many things (when a well known provider for an existent block is being created we already know the provider hierarchy so we don't need to ask you :)):&lt;/p&gt; &lt;p&gt;1. Provider Interface&lt;br&gt;2. Provider base class&lt;br&gt;3. Configuration class&lt;/p&gt; &lt;p&gt;There are basically two kinds of providers: Typed and Untyped. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Typed Providers:&lt;/strong&gt; The typed providers have strongly typed configuration. This means that you have to specify&amp;nbsp;every configuration property&amp;nbsp;in the Configuration Class and&amp;nbsp;Design-Time&amp;nbsp;Class.&lt;/p&gt; &lt;p&gt;(1) and (2) could be the same but you will probably want&amp;nbsp;to be different&amp;nbsp;in order to&amp;nbsp;separate the Interface from its implementation. The (3) is the base&amp;nbsp;class for all configuration object in the same provider hierarchy. It provides the abstract message protocol to create specific configuration objects.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;UnTyped Providers&lt;/strong&gt;: All untyped providers have&amp;nbsp;the same configuration class and it's based on key/value pairs (as strings). So the provider will receive a Name Value Collection and it will have to parse manually the values.&lt;br&gt;&lt;/p&gt; &lt;p&gt;So if you want to create Providers with a very little&amp;nbsp;effort you will probably&amp;nbsp;need an Untyped Provider but if you want a fully design-time user experience you will need&amp;nbsp;a Typed Provider.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-4926512509377223774?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/4926512509377223774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=4926512509377223774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4926512509377223774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4926512509377223774'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/03/howto-application-block-software.html' title='HowTo: Application Block Software Factory (ABSF) Part II: Providers'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-6571672890917059617</id><published>2007-03-16T09:32:00.001-07:00</published><updated>2007-03-16T09:53:14.570-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Dev'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Entlib'/><title type='text'>Validating inputs using Validation Application Block and XmlHttpRequest (Part II): The code!</title><content type='html'>&lt;p&gt;Someone has left me a comment in my&amp;nbsp;previous post about this topic asking for the code to take a look at the solution. So I think that instead of&amp;nbsp;making you waiting for a detailed explanation of the solution you could take a look at it&amp;nbsp;and see if it's useful for some specific scenarios you may be interested:&lt;/p&gt; &lt;p&gt;There is the &lt;a href="http://blog-adrianalonso.certant.com/blog/AspNetClientValidation.zip"&gt;code&lt;/a&gt;. The zip file contains&amp;nbsp;the Proxy implementation,&amp;nbsp;the JS function and the TypeDescriptor infrastructure you need to make the VAB&amp;nbsp;get the html control value.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Of course this is draft code, and it's only for demo purposes. I&amp;nbsp;hope you enjoy&amp;nbsp;it and&amp;nbsp;provide&amp;nbsp;some feedback!&amp;nbsp;&lt;/p&gt; &lt;p&gt;An example&amp;nbsp;of how to use the Client Validation could be:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="TextBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cc2:ClientPropertyProxyValidator&lt;/span&gt; &lt;br&gt;     &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ClientPropertyProxyValidator1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;br&gt;     &lt;span class="attr"&gt;ControlToValidate&lt;/span&gt;&lt;span class="kwrd"&gt;="lastNameTextBox" &lt;/span&gt;&lt;span class="attr"&gt;PropertyName&lt;/span&gt;&lt;span class="kwrd"&gt;="LastName"&lt;/span&gt; &lt;br&gt;     &lt;span class="attr"&gt;RulesetName&lt;/span&gt;&lt;span class="kwrd"&gt;="RuleSetA"&lt;/span&gt; &lt;br&gt;     &lt;span class="attr"&gt;SourceTypeName&lt;/span&gt;&lt;span class="kwrd"&gt;="ValidationQuickStart.BusinessEntities.Customer"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The example was taken from the Validation Quickstarts and you can&amp;nbsp;realize that you only have to change the control declaration!! (PropertyProxyValidator -&amp;gt; ClientPropertyProxyValidator)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-6571672890917059617?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/6571672890917059617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=6571672890917059617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6571672890917059617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6571672890917059617'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/03/validating-inputs-using-validation.html' title='Validating inputs using Validation Application Block and XmlHttpRequest (Part II): The code!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-7975106891392098304</id><published>2007-03-13T09:10:00.001-07:00</published><updated>2007-03-16T07:56:47.420-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS Extensibility'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Adding Refactor Context Menu in Visual Studio .Net Add-ins</title><content type='html'>&lt;p&gt;When you are creating a new VS .Net Add-in, you can optionally&amp;nbsp;add a command in the "Tools" Command Bar. But what if you want to add your add-in in another command bar? Well, I didn't find a nice way to do that. What I needed was to add the a Command in the Refactor Command Bar (Menu and Context Menu) so what I was looking is the following result:&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.certant.com/~aalonso/blog/AddinRefactor1.JPG"&gt; &lt;/p&gt; &lt;p&gt;&lt;img src="http://www.certant.com/~aalonso/blog/AddinRefactor2.JPG"&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;What you need to do is to use the "MenuBar" (the same&amp;nbsp;that&amp;nbsp;creates the Add-In wizard for the "Tools" Command Bar)&amp;nbsp;and the "Other Context Menus" (this is the one you need to add the menu in the context menu).&lt;/p&gt; &lt;p&gt;here it's the (simplified)&amp;nbsp;code fragment:&lt;/p&gt;&lt;pre class="csharpcode"&gt;     CommandBar menuBarCommandBar = ((CommandBars)_applicationObject.CommandBars)[&lt;span class="str"&gt;"MenuBar"&lt;/span&gt;];&lt;br /&gt;     CommandBar otherContextMenu = ((CommandBars)_applicationObject.CommandBars)[&lt;span class="str"&gt;"Other Context Menus"&lt;/span&gt;];&lt;br /&gt;&lt;br /&gt;     CommandBarControl refactorControl = menuBarCommandBar.Controls[&lt;span class="str"&gt;"Refactor"&lt;/span&gt;];&lt;br /&gt;     CommandBarPopup refactorPopup = (CommandBarPopup)refactorControl;&lt;br /&gt;&lt;br /&gt;     CommandBarControl refactorContextControl = otherContextMenu.Controls[&lt;span class="str"&gt;"Refactor"&lt;/span&gt;];&lt;br /&gt;     CommandBarPopup refactorContextPopup = (CommandBarPopup)refactorContextControl;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;What I did to discover the "Other Context Menus" CommandBar name?... well take a look at this article: &lt;a href="http://www.mztools.com/articles/2004/MZ002.htm"&gt;HOWTO: Guessing the name of a command bar to add a custom menu entry in Visual Studio .NET add-ins&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-7975106891392098304?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/7975106891392098304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=7975106891392098304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/7975106891392098304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/7975106891392098304'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/03/adding-refactor-context-menu-in-visual.html' title='Adding Refactor Context Menu in Visual Studio .Net Add-ins'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-186087617177432827</id><published>2007-03-08T11:55:00.001-08:00</published><updated>2007-03-16T07:56:47.421-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS Extensibility'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>VS Language Service with MPF/Managed Babel</title><content type='html'>&lt;p&gt;A few weeks ago I started to work on a prototype language service for Visual Studio. We want to try the new Managed Babel System... so what is that? Let's start describing the scenario: Suppose you have your own language&amp;nbsp;and you want to integrate it into Visual Studio providing Syntax Coloring, Statement completion, error markers, etc.&amp;nbsp; The VS SDK&amp;nbsp;offers the MPF (Managed Package Framework) that provides a managed "easy"&amp;nbsp;way to extend Visual Studio including support for language services.&lt;/p&gt; &lt;p&gt;And if you want to go a step further, you also have the Managed Babel System which lets you to specify a couple a files contaning the scanner and parser deifnition using LEX/YACC like syntax and tools (MPLEX, MPPG)&amp;nbsp;to generate a lot of code you need to make the language service works.&lt;/p&gt; &lt;p&gt;These are the resources I found useful to start using these frameworks:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;VS SDK&amp;nbsp;Documentation&lt;/li&gt; &lt;li&gt;VS Extra Documentation: Managed Babel Overview, MPLEX and MPPG documents included in the VisualStudioIntegration\ExtraDocumentation directory (under&amp;nbsp;your&amp;nbsp;VS SDK installation directory)&lt;/li&gt; &lt;li&gt;ManagedMyC sample: Included in the VS SDK samples.&lt;/li&gt; &lt;li&gt;&lt;a href="http://dinosaur.compilertools.net/"&gt;The Lex &amp;amp; Yacc Page&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=57&amp;amp;SiteID=1"&gt;Visual Studio Extensibility Forum&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;-Adrian&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-186087617177432827?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/186087617177432827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=186087617177432827' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/186087617177432827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/186087617177432827'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/03/vs-language-service-with-mpfmanaged.html' title='VS Language Service with MPF/Managed Babel'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-8794414925981740673</id><published>2007-02-22T12:45:00.001-08:00</published><updated>2007-03-20T11:40:05.012-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Entlib'/><title type='text'>HowTo: Application Block Software Factory (ABSF) Part I</title><content type='html'>&lt;p&gt;The Guidance Package included in the Enterprise Library V3 includes support for creating your own libray and application block. Here is the difference among them:&lt;/p&gt; &lt;p&gt;- Application Block: It contains a Provider Hierarchy (created using the "New Provider Library and Base" recipe) and may or not contain one&amp;nbsp; or more provider or implementations. The provider hierarchy is the base infrastructure that is needed to create an abstraction. Then you are able to create many providers (or services) that can be used to solve the concrete&amp;nbsp;problems. For example in the Logging Application Block one&amp;nbsp;abstraction is the Trace Listener and the Providers are the WMI Trace Listener, the email Trace Listener, the text file Trace Listener, etc. The provider library defines the base structure that the providers need to be used without depending on the implementation because for example&amp;nbsp;you ask for a name provider, say "MyTransactionTraceListener" and you don't know&amp;nbsp;where it will definitely log the entries you send to it. &lt;/p&gt; &lt;p&gt;- Provider Library: It contains only implementations of an existent Application Block.&amp;nbsp;It&amp;nbsp;must reference the Application Block project (or assembly) and it&amp;nbsp;should only&amp;nbsp;implement new Providers. It is a mechanism to extend existent Application Blocks without modifying them.&lt;/p&gt; &lt;p&gt;I will use the Brian's Animal Application Block example. Brian did some webcasts explaining how to develop a new Application Block and its design-time support. Here you have the links:&lt;/p&gt; &lt;p&gt;&lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032289570&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032289570&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US&lt;/a&gt;  &lt;p&gt;&lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032291157&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032291157&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US&lt;/a&gt;  &lt;p&gt;&lt;a title="http://www.agileprogrammer.com/oneagilecoder/archive/2006/02/09/11359.aspx" href="http://www.agileprogrammer.com/oneagilecoder/archive/2006/02/09/11359.aspx"&gt;http://www.agileprogrammer.com/oneagilecoder/archive/2006/02/09/11359.aspx&lt;/a&gt;  &lt;p&gt;The first decision you have to make when you are using the ABSF is if you want to create a new Application Block or you want to extend an existent one (You can extend your own App Blocks or the Enterprise Library existent ones).&lt;/p&gt; &lt;p&gt;If you want to create a new App Block, the first recipe you should execute should be the "New Provider Library and Base" and decide if you will have many implementations of the abstraction or only one.&amp;nbsp;It creates many files for you. Lets take a short look at them (Following the example, the Provider name is "Animal"):&lt;/p&gt; &lt;p&gt;- Interface Provider (IAnimal.cs): It allows to use the abstraction without being coupled to the implementation.&lt;br&gt;- Base class Provider (Animal.cs):&lt;br&gt;- Factory&amp;nbsp;(AnimalFactory.cs): It's the facade to get the&amp;nbsp;providers. It uses the InstanceFactory (AnimalInstanceFactory.cs) to create the instances.&lt;br&gt;-&amp;nbsp;&amp;nbsp;Configuration Data&amp;nbsp;(AnimalData.cs): Base class for all configuration objects of the Provider hierarchy.&lt;br&gt;- Custom Configuration Data (CustomAnimalData.cs): The configuration of custom provider (UnType Providers)&amp;nbsp;is quite different from the configuration of the Typed Providers. This configuration class should be used for your new custom providers.&lt;br&gt;- Appliction Blocks Settings: It represents the section that you will use to configure your application block. It's a Partial class because it's supposed to be extended by partial classes. Every new Provider Hierarchy will add a new partial class adding the Provider Hierarchy configuration structure.&lt;/p&gt; &lt;p&gt;The next step is to create the Providers (Typed or Untyped) and wire them to the Provider Hierarchy. I will post this in a future post. See you!&amp;nbsp;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-8794414925981740673?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/8794414925981740673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=8794414925981740673' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/8794414925981740673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/8794414925981740673'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/02/howto-application-block-software.html' title='HowTo: Application Block Software Factory (ABSF) Part I'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-6772612805630146425</id><published>2007-02-22T07:00:00.001-08:00</published><updated>2007-03-16T09:34:28.300-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Dev'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Entlib'/><title type='text'>Validating inputs using Validation Application Block and XmlHttpRequest (Part I)</title><content type='html'>&lt;p&gt;&lt;font face="Courier New" size="3"&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Enterprise Library V3 already includes Asp.Net Validation support using the Validation Application Block (VAB). You can download it and try the quickstarts from &lt;a href="http://www.codeplex.com/entlib"&gt;Codeplex&lt;/a&gt;. Here you have a Quickstart fragment showing how to use the PropertyProxyValidator to&amp;nbsp;validate a TextBox control:&amp;nbsp;&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="dateOfBirthTextBox"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server" /&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cc1:PropertyProxyValidator&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="dateOfBirthValidator"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;ControlToValidate&lt;/span&gt;&lt;span class="kwrd"&gt;="dateOfBirthTextBox"&lt;/span&gt;&lt;br /&gt;     &lt;span class="attr"&gt;OnValueConvert&lt;/span&gt;&lt;span class="kwrd"&gt;="dateOfBirthValidator_ValueConvert"&lt;/span&gt; &lt;span class="attr"&gt;PropertyName&lt;/span&gt;&lt;span class="kwrd"&gt;="DateOfBirth"&lt;/span&gt;&lt;br /&gt;     &lt;span class="attr"&gt;RulesetName&lt;/span&gt;&lt;span class="kwrd"&gt;="RuleSetA"&lt;/span&gt; &lt;span class="attr"&gt;SourceTypeName&lt;/span&gt;&lt;span class="kwrd"&gt;="ValidationQuickStart.BusinessEntities.Customer" /&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Then the IsValid property is used when the user submits the form and all input are validated using the server side&amp;nbsp;configuration&amp;nbsp;(this is the attributes metadata in the domain objects or the configuration file definition). But what about the client validation that provides the rest of existent Asp.Net's&amp;nbsp;validators? They use fixed or custom (provided by the user) javascript code to perform the validation and the problem is that you have to&amp;nbsp;duplicate the same logic in both C# and JS languages. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;I don't have the answer to&amp;nbsp;how to perform a fully client validation but&amp;nbsp;at least I developed a first approach to the&amp;nbsp;solution using XmlHttpRequest. This solution allows you to validate each Input when it loses focus and shows the user the errors before&amp;nbsp;continuing with&amp;nbsp;the next input:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img height="160" src="http://www.certant.com/~aalonso/blog/ValidatingInputsUsingValidationApplicationBlockAndXmlHttpRequestPartI/img01.JPG" width="564"&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The solution: I extended the PropertyProxyValidator and I added to it the CustomValidator behavior. The JS function is fixed and it sends the XmlHttpRequest to the server specifying the following 3 things:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. This is a "client side" validation.&lt;br&gt;2. The value to validate.&lt;br&gt;3. The validator id.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In the OnLoad event I check the&amp;nbsp;(1) and&amp;nbsp;(3) parameters.&amp;nbsp;Then I&amp;nbsp;execute the base EvaluateIsValid method and write the response containing the validation result and the error message to be shown. The tricky part is how to provide the GetControlValidationValue(string name) because it&amp;nbsp;gets the value from the property defined in the ValidatorPropertyAttribute on the Control to validate. This property could be different in each control and should be set with the&amp;nbsp;value to validate (2).&amp;nbsp;So with the help of reflector and kzu we realized that in the end the TypeDescriptor features are being used to get the Property value to validate. In short we registered a TypeDescriptionProvider to return the value to validate (2) before invoking the validation and we removed this after that.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I think this was too much for this post. I will continue posting more details of the&amp;nbsp;the solution in future posts so stay tuned if you are interested in!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-6772612805630146425?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/6772612805630146425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=6772612805630146425' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6772612805630146425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/6772612805630146425'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/02/validating-inputs-using-validation.html' title='Validating inputs using Validation Application Block and XmlHttpRequest (Part I)'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-79184503152045771</id><published>2007-02-19T20:37:00.001-08:00</published><updated>2007-03-16T07:57:06.312-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>I'm back</title><content type='html'>&lt;p&gt;After more that 2 years without holidays I could spent a couple of&amp;nbsp;weeks in Florianopolis, Brasil with my &lt;a href="http://solepano.blogspot.com/"&gt;Girlfriend&lt;/a&gt;&amp;nbsp;so I'am back again and I will try to update the blog more frequently.&lt;/p&gt; &lt;p&gt;This is the first time I am&amp;nbsp;posting using&amp;nbsp;the Windows Live Writer so I hope it works fine. In the next week I will try to post something about the&amp;nbsp;App Block Software Factory included in Entlib V3&amp;nbsp;(I think I will not&amp;nbsp;have enough time to some kind of tutorials but I will be able to post some basic ideas), I am doing some investigation on &lt;a href="http://msdn2.microsoft.com/en-us/library/bb165963(vs.80).aspx"&gt;Babel&lt;/a&gt; (a managed framework for creating a new Language Service in VS) and working on a lot of cool stuff.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-79184503152045771?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/79184503152045771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=79184503152045771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/79184503152045771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/79184503152045771'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/02/i-back.html' title='I&amp;#39;m back'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-4613994653365933550</id><published>2007-01-14T12:54:00.000-08:00</published><updated>2007-03-16T07:56:47.438-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Entlib'/><title type='text'>Application Block Software Factory</title><content type='html'>&lt;p class="MsoNormal"&gt;I have been working as part of the &lt;a href="http://www.codeplex.com/entlib"&gt;Enterprise Library V3&lt;/a&gt; Team in &lt;st1:city st="on"&gt;&lt;st1:place st="on"&gt;Redmond&lt;/st1:place&gt;&lt;/st1:City&gt; for the last few months. I have been mainly working in the new Block Factory feature; this is a &lt;a href="http://msdn2.microsoft.com/en-us/teamsystem/aa718948.aspx"&gt;Guidance Package&lt;/a&gt; for creating your own blocks and provider libraries. &lt;a href="http://blogs.msdn.com/tomholl/"&gt;Tom &lt;/a&gt;has published a good &lt;a href="http://blogs.msdn.com/tomholl/archive/2006/12/13/block-building-made-easy.aspx"&gt;introductory post&lt;/a&gt; about it and I am planning to post a series of entries showing how you can build your own blocks from scratch using this guidance. This probably will include:&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Create      your new Block&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Create      a Provider Hierarchy (this is the base types for your new providers)&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Create      you Providers and its configuration&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Create      the design-time support for your new block&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Extend      the new block creating a Provider Library&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-4613994653365933550?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/4613994653365933550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=4613994653365933550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4613994653365933550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/4613994653365933550'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/01/application-block-software-factory.html' title='Application Block Software Factory'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-2637691148644123727</id><published>2007-01-14T12:44:00.000-08:00</published><updated>2007-03-16T07:57:06.313-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>I'm it</title><content type='html'>&lt;p class="MsoNormal"&gt;Too many months without writing a single line of code in the blog… very bad. Thought this time I am writing because I’ve been &lt;a href="http://clariusconsulting.net/blogs/vga/archive/2007/01/08/12157.aspx"&gt;tagged &lt;/a&gt;by &lt;a href="http://www.clariusconsulting.net/blogs/vga/"&gt;VGA &lt;/a&gt;(Victor). So here you have five things that you probably don’t know about me:&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;I used      to be a bass guitar player in a rock/funk/power trio. We did a couple of      live concerts but we had a many troubles trying to find a singer. I have a      5 strings bass guitar because I’ve been influenced by my first professor      to use the bass as it were a guitar for some things. I am also looking for      a 6 strings bass guitar… I like the &lt;a href="http://www.ibanez.com/guitars/guitar.asp?model=SR506"&gt;Ibanez SR506&lt;/a&gt; very much.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;I like      sports very much. I played football in many clubs when I was a boy. Then,      the college, work, etc took me off the field. Nowadays, I sometimes play      with my friends. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;I have      recently achieved my Information System Engineer grade in the &lt;a href="http://www2.frba.utn.edu.ar/frba-portal.php"&gt;UTN&lt;/a&gt;, a very      well known university in Bs As, &lt;st1:country-region st="on"&gt;&lt;st1:place st="on"&gt;Argentina&lt;/st1:place&gt;&lt;/st1:country-region&gt;. I am very happy      with this. I think I will have more free time to social life, catch up in      other technologies apart from the ones I use every day, play the bass      guitar, etc.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;I      started programming in Pascal, then VB5, C, C++, Smalltalk, Prolog, C#,      Java. I like OOD/OOP very much. Actually, I am working for &lt;a href="http://www.clariusconsulting.net/"&gt;Clarius &lt;/a&gt;(a      really cool company in Bs As) and I am part of the &lt;a href="http://www.codeplex.com/entlib"&gt;Enterprise Library V3&lt;/a&gt;      team doing really cool stuff there as well. Before, when I was working for      &lt;a href="http://www.certant.com/es/index.php"&gt;Certant SA&lt;/a&gt;, we did a pseudo struts MVC for Java 1.2 with &lt;a href="http://incomprobable.blogspot.com/"&gt;HT &lt;/a&gt;and &lt;a href="http://www.hjg.com.ar/"&gt;HG &lt;/a&gt;that is      working very well so far. This was my first framework/dev tool/… I will      always be very happy with that work.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;I met      my super really cool &lt;a href="http://solepano.blogspot.com/"&gt;girlfriend &lt;/a&gt;in my previous job. She is an engineer and      works as a dev as well in a software company called Lagash Systems.&lt;/li&gt;&lt;/ol&gt;    &lt;p class="MsoNormal"&gt;So this is it, I want to tag: &lt;a href="http://solepano.blogspot.com/"&gt;Sole&lt;/a&gt;, &lt;a href="http://incomprobable.blogspot.com/"&gt;HT &lt;/a&gt;and &lt;a href="http://gabrey.blogspot.com/"&gt;Gustavo Brey&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-2637691148644123727?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/2637691148644123727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=2637691148644123727' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2637691148644123727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/2637691148644123727'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2007/01/too-many-months-without-writing-single.html' title='I&apos;m it'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-115464123590820171</id><published>2006-08-03T14:40:00.000-07:00</published><updated>2007-03-16T07:56:47.439-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Injecting Spring.Net Objects in NUnit Tests</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;If you are using Spring.Net and NUnit, you probably have noticed that does not exist a declarative way to inject Objects (or Services). So it seems easy I search a little in google and how I did not found results in a nutshell I decided to develop a first little version of the solution I need. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;First of all, I thought in an Attribute to define which Spring’s Object should be injected in a property or field… so:&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                                    &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;span style=""&gt;    &lt;/span&gt;///&lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;&lt;summary&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/summary&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; The Attribute lets inject a Spring Object in properties or fields&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color:gray;"&gt;///&lt;/span&gt;&lt;span style="color:green;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;[&lt;span style="color:teal;"&gt;Serializable&lt;/span&gt;, &lt;span style="color:teal;"&gt;AttributeUsage&lt;/span&gt;(&lt;span style="color:teal;"&gt;AttributeTargets&lt;/span&gt;.Field | &lt;span style="color:teal;"&gt;AttributeTargets&lt;/span&gt;.Property, &lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;Inherited = &lt;span style="color:blue;"&gt;true&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;sealed&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:teal;"&gt;InjectSpringAttribute&lt;/span&gt; : &lt;span style="color:teal;"&gt;Attribute&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; objectName;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/span&gt; InjectSpringAttribute(&lt;span style="color:blue;"&gt;string&lt;/span&gt; objectName)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this&lt;/span&gt;.objectName = objectName;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:gray;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&lt;/span&gt;&lt;span style="color:green;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;&lt;summary&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/summary&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:gray;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&lt;/span&gt;&lt;span style="color:green;"&gt; Returns the Object name that must be injected in the property or field&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:gray;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&lt;/span&gt;&lt;span style="color:green;"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; ObjectName{&lt;span style="color:blue;"&gt;get&lt;/span&gt;{&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/span&gt; &lt;span style="color:blue;"&gt;this&lt;/span&gt;.objectName;}}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;    &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Now, you could use the attribute as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                      &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:teal;"&gt;FirstService&lt;/span&gt; service;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;[&lt;span style="color:teal;"&gt;InjectSpring&lt;/span&gt;(&lt;span style="color:maroon;"&gt;"FirstService"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:teal;"&gt;FirstService&lt;/span&gt; Service&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; service; }&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;/span&gt; { service = &lt;span style="color:blue;"&gt;value&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;[&lt;span style="color:teal;"&gt;InjectSpring&lt;/span&gt;(&lt;span style="color:maroon;"&gt;"FirstService"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:teal;"&gt;FirstService&lt;/span&gt; serviceField;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;And you are not suppose to obtain IApplicationContext, getObject(…), bla bla.. anymore. The only issue remains is to define the way the attribute will be processed. For now, I have not a really elegant way to do this (in java I had been used AspectJ but with .Net???)… so I have a base TestCase from which all others Testcases extend and in the SetUp method I execute the following util static method: InjectObjects(instance) whose responsibility is to find all properties and fields decorated with the InjectSpringAttribute and set them the requested object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;I left you the code of the util method…&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;                                                                                &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"  style="font-size:8;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; InjectObjects(&lt;span style="color:teal;"&gt;Object&lt;/span&gt; instance)&lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt;&lt;br /&gt;      &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:teal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Object&lt;/span&gt; springObject;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:teal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;BindingFlags&lt;/span&gt; binding = &lt;span style="color:teal;"&gt;BindingFlags&lt;/span&gt;.Public | &lt;span style="color:teal;"&gt;BindingFlags&lt;/span&gt;.Instance | &lt;span style="color:teal;"&gt;BindingFlags&lt;/span&gt;.NonPublic;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&lt;/span&gt; (&lt;span style="color:teal;"&gt;PropertyInfo&lt;/span&gt; propertyInfo &lt;span style="color:blue;"&gt;in&lt;/span&gt; instance.GetType().GetProperties( binding ) )&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;br /&gt;              &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt;(TryGetSpringObject(propertyInfo.GetCustomAttributes(  &lt;span style="color:blue;"&gt;&lt;br /&gt;                 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typeof&lt;/span&gt;(&lt;span style="color:teal;"&gt;InjectSpringAttribute&lt;/span&gt;), &lt;span style="color:blue;"&gt;true&lt;/span&gt;),&lt;span style="color:blue;"&gt;out&lt;/span&gt; springObject))&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                    &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;propertyInfo.SetValue(instance, springObject, &lt;span style="color:blue;"&gt;null&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;span style=""&gt;                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt; &lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&lt;/span&gt; (&lt;span style="color:teal;"&gt;FieldInfo&lt;/span&gt; fieldInfo &lt;span style="color:blue;"&gt;in&lt;/span&gt; instance.GetType().GetFields(binding))&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt;(TryGetSpringObject(fieldInfo.GetCustomAttributes(&lt;br /&gt;&lt;span style="color:blue;"&gt;                   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typeof&lt;/span&gt;(&lt;span style="color:teal;"&gt;InjectSpringAttribute&lt;/span&gt;), &lt;span style="color:blue;"&gt;true&lt;/span&gt;),&lt;span style="color:blue;"&gt;out&lt;/span&gt; springObject))&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                    &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fieldInfo.SetValue(instance, springObject);&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;span style=""&gt;                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;bool&lt;/span&gt; TryGetSpringObject(&lt;span style="color:teal;"&gt;Object&lt;/span&gt;[] customAttrs,&lt;span style="color:blue;"&gt;out&lt;/span&gt; &lt;span style="color:teal;"&gt;Object&lt;/span&gt; springObject )&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt; (customAttrs != &lt;span style="color:blue;"&gt;null&lt;/span&gt; &amp;&amp;amp; customAttrs.Length &gt; 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&lt;/span&gt;( &lt;span style="color:blue;"&gt;object&lt;/span&gt; customAttr &lt;span style="color:blue;"&gt;in&lt;/span&gt; customAttrs)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color:teal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InjectSpringAttribute&lt;/span&gt; attr = customAttr &lt;span style="color:blue;"&gt;as&lt;/span&gt; &lt;span style="color:teal;"&gt;InjectSpringAttribute&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&lt;/span&gt; (attr != &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                    &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                        &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;springObject = &lt;span style="color:teal;"&gt;ContextRegistry&lt;/span&gt;.GetContext().GetObject(attr.ObjectName);&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/span&gt; &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                    &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;span style=""&gt;                &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;                &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;springObject = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/span&gt; &lt;span style="color:blue;"&gt;false&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span lang="EN-US"  style="font-size:8;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-115464123590820171?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/115464123590820171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=115464123590820171' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/115464123590820171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/115464123590820171'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2006/08/injecting-springnet-objects-in-nunit.html' title='Injecting Spring.Net Objects in NUnit Tests'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-115265217980938847</id><published>2006-07-11T14:08:00.000-07:00</published><updated>2007-03-16T07:58:22.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Methodologies'/><title type='text'>Remote Pair Programming</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Pair programming is a well known eXtreme Programming practice. Nowadays it is very frequent that developers aren't in the same physical place so it would be interesting that the IDEs could offer us remote functionality to develop with a person that could be in another part of the world. If you think that it would be useful, let’s try to define some of the potential add-ins to the IDE:&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;span lang="EN-US"&gt;To have a way to edit remote code and that the changes would be saved in the remote machine. This may be something like VNC client.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US"&gt;To have a way to communicate with other developers without exiting the IDE. Something like a chat embedded in the IDE including text, audio and video.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span lang="EN-US"&gt;...&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;Beyond the practice, this could help to assist junior developers in the typical problems that they usually have, yet we were in the same office (this let us not to get up of our chairs). &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-115265217980938847?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/115265217980938847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=115265217980938847' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/115265217980938847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/115265217980938847'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2006/07/remote-pair-programming.html' title='Remote Pair Programming'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-115202562076185218</id><published>2006-07-04T07:58:00.000-07:00</published><updated>2007-03-16T07:56:47.440-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>OB documentation and development baseline</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;st1:place st="on"&gt;OB&lt;/st1:place&gt; is a very powerful tool but it's not well documented yet, so I was thinking the didactic way to show how it can be used and extended by any project (such as tools, business projects, core utilities, etc).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;The starting point is to use the existing material:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=22f72167-af95-44ce-a6ca-f2eafbf2653c"&gt;CAB’s doc&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/cazzu/archive/2006/04/21/MsdnOBWebcast.aspx"&gt;kzu's webcast on p&amp;p&lt;/a&gt;&lt;a title="MSDN Architecture Webcast: Extending Microsoft patterns &amp;amp; practices ObjectBuilder (Level 200)" href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?culture=en-us&amp;EventID=1032293738&amp;amp;CountryCode=us" target="_blank"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.agileprogrammer.com/oneagilecoder/archive/2006/01/03/10564.aspx"&gt;&lt;st1:place st="on"&gt;&lt;/st1:place&gt;EntLib and OB by Brian Button&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;Then, I think it would be useful to meet with an “OB.chm” (or equivalent) that offers an introduction, explains the design principles to understand how to extend it, shows some scenarios where it can be used and includes the existing material and examples of the typical use cases. &lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;Another good thing would be to have a community site where developers can upload custom strategies or policies, post comments and … well, you know. As far as I know the site’s publication is imminent. &lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;Concerning development, a DSL (see DSL tools &lt;a href="http://solepano.blogspot.com/"&gt;here &lt;/a&gt;or &lt;a href="http://msdn.microsoft.com/vstudio/DSLTools/"&gt;here&lt;/a&gt;) with a Guidance Package (see &lt;a href="http://msdn.microsoft.com/vstudio/teamsystem/workshop/gat/"&gt;GAT&lt;/a&gt;) could allow an alternative to programmatic configuration and would be an excellent tool to reduce the &lt;st1:place st="on"&gt;OB&lt;/st1:place&gt;’s learning curve.&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;As a preliminary prototype, I started a doc with the following topics:&lt;/p&gt;    &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Introduction&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Terminology      (LEL style - &lt;span style="font-size:10;"&gt;Language Extended Lexicon&lt;/span&gt;)&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Design      of &lt;st1:place st="on"&gt;OB&lt;/st1:place&gt;&lt;/li&gt;&lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;Policies&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Design       Patterns used by &lt;st1:place st="on"&gt;OB&lt;/st1:place&gt;&lt;/li&gt;&lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style=""&gt;Strategy        (GoF)&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Chain        of Responsibility (GoF)&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;IoC        or Dependency Injection&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li class="MsoNormal" style=""&gt;Extending      &lt;st1:place st="on"&gt;OB&lt;/st1:place&gt;&lt;/li&gt;&lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;With       strategies&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;With       policies&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal" style=""&gt;Comparison      with to Spring’s BeanFactory&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Reference      to how CAB and EntLib uses &lt;st1:place st="on"&gt;OB&lt;/st1:place&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Examples&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;…&lt;/li&gt;&lt;/ul&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;As soon as I have a “cleaner” version, I will try to upload the doc to some site or keep on posting.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-115202562076185218?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/115202562076185218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=115202562076185218' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/115202562076185218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/115202562076185218'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2006/07/ob-documentation-and-development.html' title='OB documentation and development baseline'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-115196437487221925</id><published>2006-07-03T14:21:00.000-07:00</published><updated>2007-03-16T07:56:47.440-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>ObjectBuilder</title><content type='html'>&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;Let's talk about a cool tool named ObjectBuilder that is a subsystem used by CAB and EntLib to perform the repetitive job at the moment of creating objects.&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;ObjectBuilder (OB) &lt;/span&gt;is a &lt;a href="http://msdn.microsoft.com/practices/"&gt;Pattern &amp; Practices&lt;/a&gt; Application Block. The owners of the project define it as “a framework for composing object-oriented systems”. &lt;st1:place st="on"&gt;OB&lt;/st1:place&gt; was conceived in &lt;a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=22f72167-af95-44ce-a6ca-f2eafbf2653c"&gt;CAB &lt;/a&gt;(Composite UI Application Block). It uses the Dependency Injection pattern to populate object’s members via Constructors and Property Setters strategies. (To read more about Dependency Injection, see &lt;a href="http://www.martinfowler.com/articles/injection.html"&gt;Martin Fowler’s article&lt;/a&gt; about what dependency injection is and how it is implemented by various frameworks).&lt;br /&gt;&lt;br /&gt;&lt;st1:place style="font-weight: bold;" st="on"&gt;OB&lt;/st1:place&gt;&lt;span style="font-weight: bold;"&gt; can:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;o:p&gt;&lt;/o:p&gt;Create the appropriate objects based on configuration data.&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Manage Singleton pattern.&lt;/li&gt;&lt;li&gt;Populate public properties and execute methods on the object.&lt;/li&gt;&lt;li&gt;Communicate with objects that support the IBuilderAware interface.&lt;/li&gt;&lt;li&gt;Provide a tear down facility that can remove settings from objects by reversing the chain of operations.&lt;/li&gt;&lt;/ul&gt;The main concepts of OB are Strategies, Policies, Locator, Lifetime Container and of course the Builder. The OB's design is based on the "GoF Builder" design pattern. This pattern is  categorized as a stateful creational pattern because we first setup the  builder and then tell him (yes, tell don't ask) for a new instance... so, generally an example says than a million word...&lt;br /&gt;            &lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;span style=""&gt;1. Builder&lt;/span&gt;&lt;span style=""&gt; builder = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:teal;"&gt;Builder&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;2. Locator&lt;/span&gt;&lt;span style=""&gt; locator = CreateLocator();&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;3. builder.Policies.Set&lt;&lt;span style="color:teal;"&gt;ISingletonPolicy&lt;/span&gt;&gt;(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:teal;"&gt;SingletonPolicy&lt;/span&gt;(&lt;span style="color:blue;"&gt;true&lt;/span&gt;), &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:teal;"&gt;Foo&lt;/span&gt;), &lt;span style="color:maroon;"&gt;"foo"&lt;/span&gt;);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=""&gt;4. Foo&lt;/span&gt;&lt;span style=""&gt; obj1 = builder.BuildUp&lt;&lt;span style="color:teal;"&gt;Foo&lt;/span&gt;&gt;(locator, &lt;span style="color:maroon;"&gt;"foo"&lt;/span&gt;, &lt;span style="color:blue;"&gt;null&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=""&gt;5. Foo&lt;/span&gt;&lt;span style=""&gt; obj2 = builder.BuildUp&lt;&lt;span style="color:teal;"&gt;Foo&lt;/span&gt;&gt;(locator, &lt;span style="color:maroon;"&gt;"foo"&lt;/span&gt;, &lt;span style="color:blue;"&gt;null&lt;/span&gt;);&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="line-height: 150%;"&gt;6. Assert&lt;/span&gt;&lt;span style="line-height: 150%;"&gt;.AreSame(obj1, obj2);&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;First, in 1 and 2 we create a Builder and a Locator. Then, a Singleton Policy is added to the builder (line 3). The line 4 tells the builder for an instance of Foo and line 5 tells for another instance. Finally, the line 6 asserts that the obj1 and obj2 references are the same so the Singleton Policy works ok.&lt;br /&gt;&lt;br /&gt;When BuildUp method is fired, OB lunches a chain of responsibility (yes, another GoF design pattern), using all Strategies that internallyhas, in order that for each strategy uses to decide whether it must execute using the configured policy.&lt;br /&gt;&lt;br /&gt;OB has a lot of more power but it is not well documented yet. By now, you can find some bits in CAB's documentation and in meaningful blogs as &lt;a href="http://weblogs.asp.net/cazzu/archive/2006/04/21/MsdnOBWebcast.aspx"&gt;kzu &lt;/a&gt;and &lt;a href="http://www.agileprogrammer.com/oneagilecoder/archive/2006/01/03/10564.aspx"&gt;brian button&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-115196437487221925?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/115196437487221925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=115196437487221925' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/115196437487221925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/115196437487221925'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2006/07/objectbuilder.html' title='ObjectBuilder'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-114970013987515815</id><published>2006-06-07T10:08:00.000-07:00</published><updated>2007-03-16T08:01:38.409-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>AOP and Java Annotations</title><content type='html'>&lt;p class="Normal10pt"&gt;&lt;span style="font-size:100%;"&gt;In this post I wish to show how the combination of &lt;span style=""&gt;annotations and AOP&lt;/span&gt; can be used to perform a "parameter cannot be null" validation in a class' method.&lt;/span&gt;&lt;/p&gt;  &lt;p class="Normal10pt"&gt;&lt;span style="font-size:100%;"&gt;Suppose we have the following method that is executed only if the parameter value is not null:&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;public void serviceNotAllowedNullParameter(Object param){&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;if( param != null ){&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;  System.out.println(param.toString());&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;//do something...&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;p class="Normal10pt"&gt;One possibility is to include the same code if (copy paste the same code pattern) in all methods that need this behavior. Another one ( much more elegant ) is design a solution based on AOP and Annotations. Let’s start by defining the NotNullParameter annotation as following:&lt;/p&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;@Retention(RetentionPolicy.RUNTIME)&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;@Target(ElementType.METHOD)&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;public &lt;span style="font-weight: bold;"&gt;@interface NotNullParameter&lt;/span&gt; {&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=""&gt;Now, we proceed to decorate the method with the @NotNullParameter:&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;@NotNullParameter&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;public void serviceNotAllowedNullParameter(Object param){&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;if( param != null ){&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;System.out.println(param.toString());&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt; //do something...&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;}&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=""&gt;Though, so far we don’t do any magic. We need to find the (fashion) way to process all annotations that were defined in our code in order to add the necessary logic to perform the check validation. So… a good idea would be to use an Aspect!&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;void around(Object param):&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;execution(&lt;span style="font-weight: bold;"&gt;@NotNullParameter void ar.adalon..*.*(Object+) &lt;/span&gt;) &amp;&amp;amp;&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;args(param){&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt; &lt;span style="font-weight: bold;"&gt;  if( param == null ){&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;       &lt;span style="font-weight: bold;"&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;   }&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;   &lt;span style="font-weight: bold;"&gt;proceed&lt;/span&gt;(param);&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;p class="Normal10pt"&gt;The preceding code is read as simple as “Intercept all the execution of any method of any package or sub package of ar.adalon that accept one parameter (of type or subtype of object… hence is any instance) and is decorated with the @NotNullParameter annotation”. The around advise allows to continue (procced) or terminate (return;) with the intercepted method’s execution. Now, we can simplify our service to:&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;@NotNullParameter&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;public void serviceNotAllowedNullParameter(Object param){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;    System.out.println(param.toString());&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt; //do something...&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html"&gt;  &lt;/a&gt;&lt;p class="Normal10pt"&gt;By this way, I intended to show you how AOP crosscutting allow to break up the business logic and additional validations . &lt;/p&gt;  &lt;span style=""&gt;&lt;br /&gt;I leave some helpful links concerning annotations:&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html"&gt;http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.developer.com/java/other/article.php/10936_3556176_1"&gt;http://www.developer.com/java/other/article.php/10936_3556176_1&lt;/a&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/releases/j2se15/"&gt;http://java.sun.com/developer/technicalArticles/releases/j2se15/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www-128.ibm.com/developerworks/java/library/j-annotate1/"&gt;http://www-128.ibm.com/developerworks/java/library/j-annotate1/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www-128.ibm.com/developerworks/library/j-annotate2.html"&gt;http://www-128.ibm.com/developerworks/library/j-annotate2.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.devsource.com/article2/0,1895,1949936,00.asp"&gt;http://www.devsource.com/article2/0,1895,1949936,00.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-114970013987515815?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/114970013987515815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=114970013987515815' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/114970013987515815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/114970013987515815'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2006/06/aop-and-java-annotations.html' title='AOP and Java Annotations'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-23541384.post-114178444854794128</id><published>2006-03-07T18:20:00.000-08:00</published><updated>2007-03-16T07:57:06.313-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>Initializing blog!</title><content type='html'>&lt;p class="Normal10pt"&gt;Hi!, my name is Adrian Alonso. I’m a Java and .Net developer from &lt;st1:place st="on"&gt;&lt;st1:city st="on"&gt;BsAs&lt;/st1:City&gt;, &lt;st1:country-region st="on"&gt;Argentina&lt;/st1:country-region&gt;&lt;/st1:place&gt;. I have the necessity to share my thoughts with everyone who enjoy the OOP/OOD world so I decided (like did a lot of people) to start blogging about the things that make me spend time when I supposed that I might be watching tv, sleeping or another different matter… see you soon&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/23541384-114178444854794128?l=adrianalonso.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adrianalonso.blogspot.com/feeds/114178444854794128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=23541384&amp;postID=114178444854794128' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/114178444854794128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/23541384/posts/default/114178444854794128'/><link rel='alternate' type='text/html' href='http://adrianalonso.blogspot.com/2006/03/initializing-blog.html' title='Initializing blog!'/><author><name>Adrian Alonso</name><uri>http://www.blogger.com/profile/14085517768975072303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
