<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7881153019980313926</atom:id><lastBuildDate>Wed, 09 Jul 2025 00:45:31 +0000</lastBuildDate><category>Commentary</category><category>C#</category><category>MEF</category><category>JavaScript</category><category>jQuery</category><category>Nant</category><category>Resources</category><category>Automation</category><category>Presentation</category><category>AJAX</category><category>ASP.Net</category><category>F#</category><category>Code Shot</category><category>Continuous Integration</category><category>Personal Development</category><category>Reviews</category><category>TDD</category><category>Community</category><category>Html</category><category>VB.Net</category><category>.Net 3.0</category><category>Architecture</category><category>Books</category><category>CSS</category><category>Classic ASP</category><category>DotNetMigrations</category><category>Goals</category><category>Html5</category><category>Interviewing</category><category>IoC</category><category>Tools</category><title>Random Acts of Coding</title><description>Because Ideas and Inspiration Aren&#39;t Linear</description><link>http://randomactsofcoding.blogspot.com/</link><managingEditor>noreply@blogger.com (Anonymous)</managingEditor><generator>Blogger</generator><openSearch:totalResults>79</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-3466167406244025961</guid><pubDate>Wed, 17 Nov 2010 03:10:00 +0000</pubDate><atom:updated>2010-11-16T21:12:44.340-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Community</category><category domain="http://www.blogger.com/atom/ns#">IoC</category><category domain="http://www.blogger.com/atom/ns#">Presentation</category><title>Video - Inversion of Control with StructureMap</title><description>&lt;p&gt;This past Spring, I also attended the Iowa Code Camp.  Unlike the Fall&#39;s which just past, I recorded 3 sessions (2 plus my own) while there.  I&#39;ve had some issues finding time, space, etc. to encode the files and get them hosted somewhere.  Now that I have a Vimeo account, I will be posting any of the videos with the presenter&#39;s consent.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;The first of the videos from this Spring is from Brad Tutterow who presented on Inversion of Control with StructureMap.  This was an awesome session and thanks Brad for letting me record and post the video.&lt;/p&gt;&lt;br /&gt;
&lt;iframe src=&quot;http://player.vimeo.com/video/16908944&quot; width=&quot;500&quot; height=&quot;375&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href=&quot;http://vimeo.com/16908944&quot;&gt;Inversion of Control with StructureMap&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/user5087219&quot;&gt;James Eggers&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;For more information about what Brad&#39;s up to, check out his &lt;a rel=&quot;external&quot; target=&quot;_blank&quot; href=&quot;http://twitter.com/codebadger&quot;&gt;Twitter (@CodeBadger)&lt;/a&gt; and &lt;a href=&quot;http://www.codebadger.com&quot; rel=&quot;external&quot; target=&quot;_blank&quot;&gt;Blog (http://www.codebadger.com)&lt;/a&gt;.&lt;/p&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/11/video-inversion-of-control-with.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-4138211992155884690</guid><pubDate>Fri, 12 Nov 2010 22:15:00 +0000</pubDate><atom:updated>2010-11-12T16:15:34.805-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Community</category><category domain="http://www.blogger.com/atom/ns#">Presentation</category><title>Iowa Code Camp - Fall &#39;10 Review</title><description>&lt;div style=&quot;display: inline; float: right&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7aweZv5GHlNRCsPSnqHOgZilJ1jcibgcW7v8iBuN8uJmDkMglMYSAFeZ0MfKI8Sh3pchDxlUCFgN1RCXPfC4-1kJhp8qSu2P09enFmIJI-MhC25xh_kDDmi_BSAq9zrSH7f4svRhmtT4/s1600-h/icc_logo%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px&quot; border=&quot;0&quot; alt=&quot;icc_logo&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsCNec078_iiNfzODLQ19Iu5-uxE8XBcNCK9i1vDIFX1_lrHFgIwibtwKyuOsYHNsA374KREO1hHIrzsBtdgYU6jediBPPWXRzamZL_yOQoMLCRBmBDJB3p__9SESrzcq9G3eil9DWPBI/?imgmax=800&quot; width=&quot;482&quot; height=&quot;134&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Over the first weekend of November, I attended and spoke at the Iowa Code Camp in Des Moines, Iowa.  Every time I attend, the event is great and everyone there are some of the top developers in the area.  As with any conference I go to, I want to make sure and write a review on the experience overall. I was able to attend 4 sessions at this code camp after doing my presentation on &lt;a href=&quot;http://randomactsofcoding.blogspot.com/2010/11/presentation-low-hanging-fruit-of-html5.html&quot;&gt;the Low Hanging Fruit of Html5&lt;/a&gt;.  Below is a rundown of each session I attended.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Getting Dirty with Android - by Brent Edwards&lt;/h3&gt;&lt;p&gt;I&#39;ve talked with Brent on a number of occasions via Twitter and was looking forward to attending his Android development presentation.  I had looked at Android development briefly in the past; however, hope to get into it more now that I&#39;ve traded in my iPhone 3G for an HTC Evo.  Brent did a really good job on showing the basics of Android development using Eclipse on a Windows system.  He wisely had all examples setup prior to the presentation in order to not bore the audience by manually typing the xml associated with Android&#39;s layout.  He also made a point to educate the audience on some of the things that may cause a new Android developer to get hung up.  His presentation was one of the few that I&#39;ve been to that I couldn&#39;t find hardly anything to provide constructive feedback on.  He was well practiced on the topic, he had the examples working well, and he was able to field any questions.  Overall, it was a great presentation that I&#39;d recommend to anyone looking to get into Android development.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Curriculum Development Workshop - by Dustin Thostenson&lt;/h3&gt;&lt;p&gt;Every so often on Twitter, a conversation will come up on a number of academic topics.  A few months ago, the topic of how to build a better college curriculum for software developers or engineers came up.  After multiple hours on Twitter, many conceded that moving the conversation to a forum like Iowa Code Camp would be a good idea.  This session was solely a discussion about that topic. Dustin is on the curriculum board at the Des Moines Area Community College which makes the topic more than just a theoretical discussion. In the session, we had a large mix of educators, students, and other people who varied in how they came about being a software practitioner.  Dustin had a number of pseudo-exercises he asked us to do in order to limit group think early on.  From these exercises, the discussion focused on the fact that some of the most common set of courses that the attendees deemed were most important were not technical at all.  Courses like public speaking, group dynamics, research methods, and writing were all rated as some of the most important while language specific skills were some of the lowest.  From everything discussed, I left the discussion thinking not what courses are the most important for a college student but more about how to inspire a student to have patience in learning true programming skills.  Knowing how to cut code is the least important aspect of my day job and, after the discussion, I&#39;m not alone in feeling that way.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Using and Extending Django - by Matt Morrison&lt;/h3&gt;&lt;p&gt;By day, I&#39;m a .Net guy.  By night, I love programming in anything that isn&#39;t tied to Microsoft.  I enjoy working in Python and have dabbled in Django a little bit; however, nothing enough to feel comfortable to really ensure that I was doing things right.  This session was a slight treat for me since I could learn the Django way of doing things from a guy that actually uses Python daily.  Matt&#39;s presentation was very open which was bittersweet.  I was able to ask questions and help mold the presentation to the aspects that I&#39;m interested in; however, it also lead to some uneasy pauses and breaks in the flow of the presentation while Matt was soliciting the audience on for what they may be interested in.  Overall, there was a lot of information that I saw and gained from the presentation even though it was very rudimentary.  I would have enjoyed seeing a bit more structure but overall, the content was good and it was obvious that Matt knew the subject matter.  I also would have liked to see a few steps on how to start the application from nothing and how he located and setup the eggs.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Using Django and TDD to version Databases - by Matt Morrison&lt;/h3&gt;&lt;p&gt;In a continuation of the previous conversation, Matt focused more on how to do TDD with Django as well as introduced how to work with South, a Django add on for doing database migrations and versioning through modifying your model. This talk was very beneficial for me in that I saw TDD in Python/Django, more specific Django stuff, and how Django does database migrations.  I was very curious on the database migration elements because of my involvement in the Dot Net Migrations open source project in the .Net space.  In comparison with the previous topic, this presentation was very structured and spot on.  It answered a lot of my questions and provided me a ton of insight.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Overall Reflections&lt;/h3&gt;&lt;p&gt;Every conference I go to I enjoy.  Iowa Code Camp is no different.  This time around, I saw a large amount of Macs and a bit more diversity in the sessions than in past conferences, which were very .Net heavy.  While I&#39;m a .Net guy, I have shifted my presentation topics away from .Net in order to provide different viewpoints to the audience.  I like seeing how conferences like this are providing a forum for such as well.  I don&#39;t regret going to any of the presentation that I went to though wish I was able to clone myself and attend others as well. I only recorded my own presentation this time around due to logistical issues that I encountered in the Spring.  Next Spring&#39;s code camp I may have a different camcorder in order to make things a bit easier to off load and recharge the camera easier.  Beyond that, I&#39;m looking forward to playing around with the knowledge I picked up last weekend.  I also am working on some additional presentations as well.  Next year is going to be a busy year for me as a presenter and I can&#39;t wait to see how things go.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Speaker Contact Info&lt;/h3&gt;&lt;div&gt;Brent Edwards - &lt;a href=&quot;http://twitter.com/brentledwards&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;@brentledwards&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Dustin Thostenson - &lt;a href=&quot;http://twitter.com/dustinson&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;@dustinson&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Matt Morrison - &lt;a href=&quot;http://twitter.com/mattjmorrison&quot; target=&quot;_blank&quot; rel=&quot;external&quot;&gt;@mattjmorrison&lt;/a&gt;&lt;/div&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/11/iowa-code-camp-fall-10-review.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsCNec078_iiNfzODLQ19Iu5-uxE8XBcNCK9i1vDIFX1_lrHFgIwibtwKyuOsYHNsA374KREO1hHIrzsBtdgYU6jediBPPWXRzamZL_yOQoMLCRBmBDJB3p__9SESrzcq9G3eil9DWPBI/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-7383770902988071575</guid><pubDate>Wed, 10 Nov 2010 02:40:00 +0000</pubDate><atom:updated>2010-11-09T20:40:02.980-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Html5</category><category domain="http://www.blogger.com/atom/ns#">Presentation</category><title>Presentation: Low Hanging Fruit of Html5</title><description>This past weekend, I participated at the &lt;a href=&quot;http://www.iowacodecamp.com&quot;&gt;Iowa Code Camp&lt;/a&gt; in Des Moines, Iowa, USA.  While at the event, I spoke on some of the elements of HTML5 that can be used in today&#39;s web design and development world.  Below is a copy of the materials, the presentation, and a video of my session.  I plan on doing additional sessions on or relating to HTML5 in the near future so stay tuned.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Presentation&lt;/h3&gt;&lt;div class=&quot;prezi-player&quot;&gt;&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;.prezi-player { width: 550px; } .prezi-player-links { text-align: center; }&lt;/style&gt;&lt;object id=&quot;prezi_idrnhayrp9nc&quot; name=&quot;prezi_idrnhayrp9nc&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; width=&quot;550&quot; height=&quot;400&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://prezi.com/bin/preziloader.swf&quot;/&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;/&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot;/&gt;&lt;param name=&quot;flashvars&quot; value=&quot;prezi_id=idrnhayrp9nc&amp;amp;lock_to_path=0&amp;amp;color=ffffff&amp;amp;autoplay=no&amp;amp;autohide_ctrls=0&quot;/&gt;&lt;embed id=&quot;preziEmbed_idrnhayrp9nc&quot; name=&quot;preziEmbed_idrnhayrp9nc&quot; src=&quot;http://prezi.com/bin/preziloader.swf&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; width=&quot;550&quot; height=&quot;400&quot; bgcolor=&quot;#ffffff&quot; flashvars=&quot;prezi_id=idrnhayrp9nc&amp;amp;lock_to_path=0&amp;amp;color=ffffff&amp;amp;autoplay=no&amp;amp;autohide_ctrls=0&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class=&quot;prezi-player-links&quot;&gt;&lt;p&gt;&lt;a title=&quot;A look at some of the parts of HTML 5 you can use today and tips for the future.&quot; href=&quot;http://prezi.com/idrnhayrp9nc/the-low-hanging-fruit-of-html-5/&quot;&gt;The Low-Hanging Fruit of HTML 5&lt;/a&gt; on &lt;a href=&quot;http://prezi.com&quot;&gt;Prezi&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h3&gt;Materials&lt;/h3&gt;LINK: &lt;a href=&quot;http://cid-3cb659da2d58facb.office.live.com/self.aspx/Public/Low-Hanging%20Fruit%20of%20Html5/HTML5%20Demos.zip&quot;&gt;Files used in the presentation.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Video Recoding&lt;/h3&gt;&lt;iframe src=&quot;http://player.vimeo.com/video/16643971&quot; width=&quot;400&quot; height=&quot;300&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href=&quot;http://vimeo.com/16643971&quot;&gt;Low Hanging Fruit of HTML5&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/user5087219&quot;&gt;James Eggers&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/11/presentation-low-hanging-fruit-of-html5.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-470109423096481437</guid><pubDate>Wed, 20 Oct 2010 13:00:00 +0000</pubDate><atom:updated>2010-10-20T08:00:07.804-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Interviewing</category><title>A Tale of Two Interviews</title><description>&lt;p&gt;&lt;i&gt;Disclaimer: This story is completely true, sort of.  The names and faces of those depicted in this blog post have been changed in order to protect the innocent and incompetent alike. Any similarity to people or places you know is completely coincidental. Furthermore, no animals were hurt in the publishing of this blog post.&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Over my career, I have had the opportunity to be on both sides of an interview table.  I have searched and applied for jobs as well as sought the assistance of recruiters.  I&#39;ve also been the one looking for employees to add to my team to replace ones that left or to expand the team. With every experience on either side of the table, I&#39;ve walked away feeling that something wasn&#39;t quite right with the process as a whole.  These notions bubbled up this past week when a good friend of mine, we&#39;ll call him Bob, was telling me about his tales while searching for a job.  I figured I&#39;d retell the story here.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Bob is a fairly seasoned programmer with a number of years and languages under his belt.  It takes a lot for him to change jobs because he enjoys trying to help companies become better and work close with the friends on his team.  He&#39;s active in the community and has a thirst for learning anything development related. For a variety of reasons, Bob is at a point where he wants to change jobs and decides to do the interview dance.  With in a short time of looking, two interview opportunities presented themselves to him.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;The first was with a smaller company that sounded like a breath of fresh air compared to the corporate cubicle land that Bob is attempting to leave.  The interview was held at a local coffee shop and with two very knowledgeable members of the company&#39;s development team. Having known his work from the community and online, the interviewers focused a lot on Bob as a person and what he&#39;s looking for in a company, a team, and a career.  There were some discussion on technical topics; however, many stemmed from Bob&#39;s questions about the company&#39;s processes and infrastructure.  Shortly into the interview, Bob found himself to be very comfortable, candid, and casual with the two people he was sharing the conversation with.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Later that same day, Bob had another interview in a different part of town.  The interview was with a little bit bigger company that was comparable in size to his current employer.  The interview was in a very similar office building as well.  The receptionist paged the interviewer for him and then he was escorted into a small, closet of a meeting room where 2 chairs and a table barely fit.  Walking through, Bob noticed the high cube walls, the silence in amongst the desks, and the lack of expressions on the faces of the few people he saw.  Over the course of the interview, a lot of questions were asked that discussed fundamentals and text book definitions. There were some questions about Bob&#39;s past that were not really acknowledged by the interviewer when an answer was given.  When everything was said and done, Bob was escorted back to the entrance and ways were parted.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;This story provides an interesting look at how 2 different approaches are taken to a common problem; how does a company attract and hire good developers and how do developers identify good companies to work for.  Hopefully, I don&#39;t have to say which of the two experiences portrayed above attracted Bob more.  The interesting thing that came to my mind while Bob told me this story was not only the differences between the companies but how important the interview process is to both the candidate and the companies.  Based on the story, which company appeals to you and why?  How was your perception created on each company, which you had no prior knowledge of? &lt;/p&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/10/tale-of-two-interviews.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-7100841735211833646</guid><pubDate>Wed, 13 Oct 2010 12:59:00 +0000</pubDate><atom:updated>2010-10-13T09:40:11.969-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><title>My Development Toolbox</title><description>&lt;p&gt;Over the years I&#39;ve carried around my own personal toolbox for development.  The contents has changed throughout the years; however, the purpose has remained the same; to provide me with tool, templates, and snippets to allow me to build my web pages quicker, faster, and cheaper.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;In this week&#39;s post, I&#39;ll walk you through what I currently keep in my toolbox from a high level so that you may be able to build your own or add some new tools into one you already have.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;General Guidelines&lt;/h3&gt;&lt;p&gt;Before we dive too much into the contents, I want to comment on a few guidelines that I try to keep when updating my toolbox.  One of the largest guidelines that I attempt to follow is that &lt;b&gt;everything must be free to be reused and redistributed&lt;/b&gt;.  The reason for this is simple, I hope to applies these items into a variety of my projects and thus am redistributing them.  I don&#39;t want to worry about paying a licensing fee every time that I want to add this module or use that font.  Keeping this open, free, and available to be redistributed makes everything a lot easier.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;The second guideline that I follow is to &lt;b&gt;try and keep a copy of the license and author information of everything&lt;/b&gt; in your toolbox.  This includes deciding on a license that fits your views and opinions for your own works that you add.  Keeping a license around will help if someone asks you when you attempt to integrate it into a project.  In addition to the licenses is the author&#39;s or the source&#39;s information.  This could be nothing more than a url in my opinion but knowing where you got something and who did it can help you build a network of people and sites to keep an eye on for new stuff they may develop or post.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;The third primary guideline that I try to keep is to &lt;b&gt;store your toolbox in the cloud and on a flash drive&lt;/b&gt;.  Some people argue that with the device syncing powers of tools like &lt;a rel=&quot;external&quot; title=&quot;Dropbox&quot; href=&quot;http://www.dropbox.com&quot; target=&quot;_blank&quot;&gt;Dropbox&lt;/a&gt; or &lt;a rel=&quot;external&quot; title=&quot;Evernote&quot; href=&quot;http://www.evernote.com&quot; target=&quot;_blank&quot;&gt;Evernote&lt;/a&gt; that you don&#39;t really need to keep a copy with in arm&#39;s reach on a thumb drive; however, I still like the speed of reaching into my bad and tossing someone my thumb drive to get the file(s) in the event I can&#39;t interact with the cloud easily or quickly.  This is often the case at conferences.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;CSS Examples&lt;/h3&gt;&lt;p&gt;The first item I currently have in my toolbox is a group of files that provide various CSS examples.  These are anything from templates to style a vcard, a CSS reset file, or examples of things that I took more than 2 seconds of effort to truly learn how to do.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Fonts&lt;/h3&gt;&lt;p&gt;This is an area where I&#39;m still getting my feet wet; however, with the ability to embed fonts into your web pages through CSS3, having open and freely-redistributable fonts comes in handy.  One good resource for learning some of the legal nuances of embedding fonts, I highly encourage you to check out &lt;a rel=&quot;external&quot; title=&quot;Font Embedding&quot; href=&quot;http://www.fontembedding.com&quot; target=&quot;_blank&quot;&gt;www.FontEmbedding.com&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Icons&lt;/h3&gt;&lt;p&gt;Having the right icon for a given scenario or page can cause huge improvements to a page&#39;s design.  Having the wrong icons can destroy just the same as well.  I found myself searching for just the right icons on the web and in various libraries way too much.  Now, I keep track of the icons that I have frequently used and will constantly add to them as needed. One item that I&#39;ve began to track in here too are example favicon.ico files and icons for iPhone shortcuts.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Images&lt;/h3&gt;&lt;p&gt;The reason why I have Icons and Images in separates folders in my toolbox is because of their intent.  I keep images for background images and stock photos.  The stock photos I&#39;ll probably branch out as my collection grows.  As for the backgrounds, this ranges from simple gradients to watermarks to signify drafts or beta releases.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Scripts&lt;/h3&gt;&lt;p&gt;I use this folder in a similar way to that which I use the CSS section.  Here I keep a list of utility scripts (like an Html5 Feature Detection script) as well as snippets on how to use certain jQuery plug ins or do something else through JavaScript&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Templates&lt;/h3&gt;&lt;p&gt;This section of my toolbox is used for a variety of different scenarios.  Since my day job is working in the Microsoft .Net space, I have a number of Project and File templates in this directory (since the ones that come out of the box in Visual Studio hurt my head).  This is also the place where I keep track of other design and layout templates that I&#39;ve either made or have found online&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Utilities&lt;/h3&gt;&lt;p&gt;My utilities folder is for any reusable, compiled component.  This include stuff like a tool for handling database version migrations, database documentation, a random password generator, and abstraction classes that I can quickly plug into my .Net projects without worrying about rewriting the same abstraction layers over and over again.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Web File Examples&lt;/h3&gt;&lt;p&gt;This folder I use for references and as a launching pad for creating some files.  This folder contains a files that lists the DocTypes that I use the most, an example robots.txt, a sitemap.xml, opensearch.xml, and dublin.rdf.  These are files that are missed in a number of templates and having them available makes it easy to add them in.&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Personal Information&lt;/h3&gt;&lt;p&gt;This isn&#39;t so much a folder as just a category of other items you should toss into your toolbox.  Some of these items would be check lists that you use to keep yourself on track or to define a process that you have with your workflow, a copy of a personal biography that you may use for a presentation, a vcard of your contact information, a copy of the license(s) you place your own work under, and a copy of your CV or Resume.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;That&#39;s my current toolbox.  Obviously it&#39;s web heavy; however, that&#39;s where I find myself the most these days and what I enjoy doing.  There&#39;s so much out there to learn and do and apply to your day jobs, it&#39;s nice to be able to have the resources you need and are familiar with at your finger tips.&lt;/p&gt;&lt;br /&gt;
-J&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_url = &#39;http://randomactsofcoding.blogspot.com/2010/10/my-development-toolbox.html&#39;;&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_title = &#39;My Development Toolbox&#39;;&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_blurb = &#39;An overview of the types of items I keep with me as I develop from project to project.&#39;;&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_style = &#39;2&#39;;&lt;/script&gt;&lt;br /&gt;
&lt;script language=&quot;javascript&quot; src=&quot;http://widgets.dzone.com/links/widgets/zoneit.js&quot;&gt;&lt;/script&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/10/my-development-toolbox.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-5088754471859356478</guid><pubDate>Wed, 06 Oct 2010 13:40:00 +0000</pubDate><atom:updated>2010-10-06T10:02:17.606-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code Shot</category><category domain="http://www.blogger.com/atom/ns#">CSS</category><category domain="http://www.blogger.com/atom/ns#">Html</category><title>Code Shot - hCard Template</title><description>&lt;style type=&quot;text/css&quot;&gt;
span, abbr { display:inline; }
div.caption
{
font-weight:bold;
font-size:1.1em;
}
code
{
margin:0px 5px;
padding:5px;
width:90%;
font-family:&quot;Courier New&quot;, courier, monospace;
font-size:0.8em;
overflow:auto;
overflow-y:hidden;
display:block;
background-color:#eee;
border:1px solid #ccc;
border-radius:10px;
white-space:pre;
line-height:0.8em;
}

div.vcard
{
    margin:5px;
}

div.vcard .tel a
{
    text-decoration:none;
    color:Black;   
    cursor:default; 
}

div.vcard .adr .region
{
    display:inline;
}

&lt;/style&gt;&lt;br /&gt;
In this Code Shot post, I&#39;ll provide a sample template that I&#39;ve used in the past for marking up and styling address information in the hCard microformat.  &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;Html Template&lt;/div&gt;&lt;code&gt;&lt;br /&gt;
&amp;lt;div class=&quot;vcard&quot;&amp;gt;&lt;br /&gt;
&amp;lt;a class=&quot;fn org url&quot; href=&quot;http://randomactsofcoding.blogspot.com&quot;&amp;gt;Random Acts of Coding&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;div class=&quot;adr&quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&quot;street-address&quot;&amp;gt;123 Any Street&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span class=&quot;locality&quot;&amp;gt;Some Town&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;abbr class=&quot;region&quot; title=&quot;Missouri&quot;&amp;gt;MO&amp;lt;/abbr&amp;gt;&lt;br /&gt;
&amp;lt;span class=&quot;postal-code&quot;&amp;gt;12345&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;div class=&quot;country-name&quot;&amp;gt;USA&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&quot;tel&quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&quot;type&quot;&amp;gt;Work&amp;lt;/span&amp;gt; &amp;lt;a rel=&quot;nofollow&quot; href=&quot;tel:1234567890&quot;&amp;gt;123-456-7890&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&quot;tel&quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&quot;type&quot;&amp;gt;Mobile&amp;lt;/span&amp;gt; &amp;lt;a rel=&quot;nofollow&quot; href=&quot;tel:0987654321&quot;&amp;gt;098-765-4321&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;Email:&lt;br /&gt;
&amp;lt;span class=&quot;email&quot;&amp;gt;name@domain.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;CSS Template for the Html&lt;/div&gt;&lt;code&gt;&lt;br /&gt;
div.vcard&lt;br /&gt;
{&lt;br /&gt;
margin:5px;&lt;br /&gt;
font-size:0.6em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .url&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .org&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .fn&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .adr&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .adr .street-address&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .adr .locality&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .adr .region&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .adr .postal-code&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .adr .country-name&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .tel&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .tel a&lt;br /&gt;
{&lt;br /&gt;
text-decoration:none;&lt;br /&gt;
color:Black;   &lt;br /&gt;
cursor:default; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
div.vcard .email&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;Example&lt;/div&gt;&lt;div class=&quot;vcard&quot;&gt;&lt;a class=&quot;fn org url&quot; href=&quot;http://randomactsofcoding.blogspot.com&quot;&gt;Random Acts of Coding&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;adr&quot;&gt;&lt;div class=&quot;street-address&quot;&gt;123 Any Street&lt;/div&gt;&lt;span class=&quot;locality&quot;&gt;Some Town&lt;/span&gt; &lt;abbr class=&quot;region&quot; title=&quot;Missouri&quot;&gt;MO&lt;/abbr&gt;    &lt;span class=&quot;postal-code&quot;&gt;12345&lt;/span&gt; &lt;span class=&quot;country-name&quot;&gt;USA&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;tel&quot;&gt;&lt;span class=&quot;type&quot;&gt;Work&lt;/span&gt;: &lt;a rel=&quot;nofollow&quot; href=&quot;tel:1234567890&quot;&gt;123-456-7890&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;tel&quot;&gt;&lt;span class=&quot;type&quot;&gt;Mobile&lt;/span&gt;: &lt;a rel=&quot;nofollow&quot; href=&quot;tel:0987654321&quot;&gt;098-765-4321&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Email: &lt;span class=&quot;email&quot;&gt;name@domain.com&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;Additional Resources&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http://www.microformats.org&quot; target=&quot;_blank&quot;&gt;http://www.microformats.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http://goo.gl/eTew&quot; target=&quot;_blank&quot;&gt;MichromeFormats extension for Chrome&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_url = &#39;http://randomactsofcoding.blogspot.com/2010/10/code-shot-hcard-template.html&#39;;&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_title = &#39;Code Shot - hCard Template&#39;;&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_blurb = &#39;A quick code snippet of formatting hCard information using CSS, Html, and the vCard Microformat.&#39;;&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_style = &#39;2&#39;;&lt;/script&gt;&lt;br /&gt;
&lt;script language=&quot;javascript&quot; src=&quot;http://widgets.dzone.com/links/widgets/zoneit.js&quot;&gt;&lt;/script&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/10/code-shot-hcard-template.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-2755753481279120526</guid><pubDate>Fri, 01 Oct 2010 01:51:00 +0000</pubDate><atom:updated>2010-09-30T21:09:07.442-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code Shot</category><category domain="http://www.blogger.com/atom/ns#">Html</category><title>Code Shot – Doctypes</title><description>&lt;style type=&quot;text/css&quot;&gt;
div.caption
{
font-weight:bold;
font-size:1.1em;
}
code
{
margin:0px 5px;
padding:5px;
width:90%;
font-family:&quot;Courier New&quot;, courier, monospace;
font-size:0.8em;
overflow:auto;
overflow-y:hidden;
display:block;
background-color:#eee;
border:1px solid #ccc;
border-radius:10px;
white-space:pre;
}
&lt;/style&gt;  &lt;br /&gt;
First Quick Code Shot…less talk; more code.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;Xhtml 1.0 Strict&lt;/div&gt;&lt;code&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;gt;&lt;/code&gt;  &lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;Xhtml 1.0 Transitional&lt;/div&gt;&lt;code&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt; &lt;/code&gt;  &lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;Html 4.01 Strict&lt;/div&gt;&lt;code&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01//EN&amp;quot; &amp;quot;http://www.w3.org/TR/html4/strict.dtd&amp;quot;&amp;gt;&lt;/code&gt;  &lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;Html 4.01 Transitional&lt;/div&gt;&lt;code&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.01 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/html4/loose.dtd&amp;quot;&amp;gt; &lt;/code&gt;&lt;br /&gt;
&lt;div class=&quot;caption&quot;&gt;Html 5&lt;/div&gt;&lt;code&gt;&amp;lt;!DOCTYPE html &amp;gt;&lt;/code&gt;  &lt;br /&gt;
There are others; however, these are the primary ones that I either use or have seen a decent amount in the wild.&lt;br /&gt;
&lt;br /&gt;
-J</description><link>http://randomactsofcoding.blogspot.com/2010/09/quick-code-snippetdoctypes.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-8403626583255288043</guid><pubDate>Wed, 29 Sep 2010 17:26:00 +0000</pubDate><atom:updated>2010-09-29T12:26:24.796-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code Shot</category><category domain="http://www.blogger.com/atom/ns#">Commentary</category><title>A New Format Coming</title><description>I&#39;ll admit, I&#39;ve been pretty lax on my blogging as of late. &amp;nbsp;This has been due to a number of reasons / excuses that I won&#39;t bore you with. &amp;nbsp;Regardless, it&#39;s a part of my life that I&#39;m working on getting back into the habit with.&lt;br /&gt;
&lt;br /&gt;
One issue that I always had with blogging was the time aspect. &amp;nbsp;A commentary post would take me 2-4hrs to write and post while a code one could take me 8-24hrs depending on the size and depth of the material.&lt;br /&gt;
&lt;br /&gt;
Starting this week, a new format of code-related posts will begin to trickle onto this blog. &amp;nbsp;I&#39;m dubbing these Code Shots since they are going to be terse and more focused on the code them the blocks of text surrounding them. &amp;nbsp;This format makes a lot more sense when you 1) the samples are simple and short and 2) most of the people who read this blog can read code.&lt;br /&gt;
&lt;br /&gt;
Expect some Code Shots on topics ranging from Html5 to JavaScript and even inter-language interop. &lt;br /&gt;
&lt;br /&gt;
Stay Tuned!&lt;br /&gt;
&lt;br /&gt;
- J</description><link>http://randomactsofcoding.blogspot.com/2010/09/new-format-coming.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-567827503032731790</guid><pubDate>Wed, 08 Sep 2010 02:11:00 +0000</pubDate><atom:updated>2010-09-07T21:13:51.410-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Commentary</category><title>The Paradox of Choice for a Programmer</title><description>&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVAYeM9c2vW0ACCovqV9RMzOssZPfCUGKbBkU5QTf1gsMpkxONzgNMtx85GKB7oRWcGa1eOx7rA506H1gApPrsES9Vh4NnMrgx1gC3g_YJLd-uoAjr8UneLh3uws-ZgakQ4syVQOKRmHU/s1600-h/apple-1984-advert%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;apple-1984-advert&quot; border=&quot;0&quot; alt=&quot;apple-1984-advert&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcaA0UgWCj1rQF06seChi8kADXfaAQKyl42dgAW1oqfsYyZBSGLKanIAAR8BNMwq9x3TE1jKtTUSqZaJ58_4NZanxK4kUAftVauuC_LG-TObZc69zUWuiJbqll-plv8btn-5gPSjNLjik/?imgmax=800&quot; width=&quot;193&quot; height=&quot;143&quot; /&gt;&lt;/a&gt; In everyone’s life, we strive to find our own self-identity.&amp;#160; Some of us establish ourselves rather naturally while other’s take a while to truly understand and mold their own self truth.&amp;#160; We see it every day with every time we experience new things and try out different solutions to a problem; be it in algebra, Rubik’s Cube, or even a more socially-related problem.&amp;#160; This search for self-identity is apparent to everyone since no one wants to be a nameless drone who mindlessly obeys big brother; we want to stand out from the rest.&amp;#160; We want to be unique, just like everyone else.&amp;#160; This sense of identity and individualism surpasses the realm of how an individual acts or behaves, it also crosses into a realm of how a person shapes their career. While this is an extremely important factor in some fields (i.e. Journalism, Politics, Sports, etc), it can also cause issues in other fields.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Individualism in a career leads to people trying to be the best at what they do. Journalists and photographers strive for the recognition of fame and prizes; politicians strive to be elected. People strive to seek value in what they do and eventually hope to build a reputation (and furthermore a legacy) around their works and their individual brands; however, this could also turn into a self destructive motive in some fields.&amp;#160; One such field is software development.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;No field isn’t without its celebrities.&amp;#160; In the greater Information Technology field; it’s hard to argue that Bill Gates, Steve Jobs, and Linus Torvalds are amongst some of the names that come to mind as “celebrities” in the culture.&amp;#160; In every development circle, be it .Net, Java, Lisp, or Ruby, there are also those types of people who tend to stand out and people recognize the names. At a micro level inside of your company, is there a celebrity or “go-to” person whenever there’s a crisis that tends to wave their hands and make the fires go away?&amp;#160; Here’s the catch though, what happens when your company has more than 1 of these people?&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Software developers are a lot like carpenters, in my opinion, when it comes to individualism. Each professional has a set of restraints but no 2 may do the same thing the same way. Sure there are frameworks and regulations that have to be adhered to but in the end, how the product was ultimately constructed could be vastly different.&amp;#160; This is where the issue of individualism in our profession can be seen the greatest.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;I once worked for a company who wrote a number of different software solutions for a wide variety of clients.&amp;#160; These projects ranged from Business-To-Business process to e-Commerce sites to internally used CRMs.&amp;#160; For years the request always came in and for years the same types of application were developed from scratch.&amp;#160; Admittingly, I was part of the problem; I focused on the differences and argued that a standard platform couldn’t be developed. Experience has taught me that I was wrong in those days.&amp;#160; The issue with reinventing these applications each time was each one was different to varying degrees depending on who developed it.&amp;#160; As developers on the team shifted from project to project or as new developers came on board, the projects turned into a nightmare of a learning curve.&amp;#160; In addition to the learning curve was the issue that it caused deadlines to be extended. The only advantage was that each developer learned from their past experiences (usually).&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&amp;#160;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz_1x2nJd2ewZcTuEdSdySsqac1xYHOXVKW0RRI6H1Y3hXy_ypSn89rRwtTG18JkvXkej6B_7_XKoBZ4t6rk_Lp_hiwiktu_Yh1GOrO_dcXwqJWDWMx_-Cr3SUWJIn9uqgLVOGu8XmhTE/s1600-h/unique%5B3%5D.jpg&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: block; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto&quot; title=&quot;unique&quot; border=&quot;0&quot; alt=&quot;unique&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBXXuF-Qx2nqk-FSw4tdYbHD5LNutU5tarYfYcZ2-MTjZNqTbCFpCOcZwhOK-mB0GCXgvHtxWuwZ9NxgqEmS1WkY__a7JU5nWbQx0uYM2B2uxO_X7E2Ztx_Y0aVTnh94fFGX8cj6THDgE/?imgmax=800&quot; width=&quot;334&quot; height=&quot;252&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Obviously, the need to automate the foundation was seen but at this point, the paradox of choice sat in.&amp;#160; Which of the various frameworks that other people had made do you chose to be the basis of all applications going forward? Since we’re talking about business-related decisions, it could turn political at times and personal matters of pride at others. It’s not an easy question to answer.&amp;#160; The same can be said about a new, rank amateur developer who just started or is thinking about starting.&amp;#160; Not only is it a choice of platform (Web, desktop, etc.) or language; but also a matter of what frameworks to use with such.&amp;#160; If we target .Net and pick C# and the web platform; MS now has ~4 frameworks to focus on (Silverlight, WebForms, MVC, WebPages)…looking at just MVC, there’s a large list of subprojects by other developers within the community who enhanced it in their own image; some more widely known than others.&amp;#160; A person may ask which is better on a forum and then the whole pissing match of which framework tastes great or is less filling.&amp;#160; A person become paralyzed by the amount of analysis he or she feels just to make a simple decision. This is the paradox of choice; too many choices leads to analysis paralysis. Below is a video that accentuates the paradox of choice further if you are interested.&lt;/p&gt;&lt;br /&gt;
&lt;p style=&quot;display: block; margin-left: auto; margin-right: auto&quot;&gt;&lt;object width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/VO6XEQIsCoM?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/VO6XEQIsCoM?fs=1&amp;amp;hl=en_US&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;So what is a person and/or company to do when faced with a number of individuals who believe theirs is the best way?&amp;#160; Ultimately, just decide.&amp;#160; To an extent, this is risky; however, nothing says that you can’t change later.&amp;#160; Egos will subside since the goal is to work more efficiently as a company, as a collective.&amp;#160;&amp;#160; Put the vocal critics in the forefront of the decision since they, theoretically speaking, will be the most critical of the decision and have their eyes open the most to issues that may arise.&amp;#160; For those issues, those same people may turn into the ones who enhance the decision more into something even better for the whole as well. Furthermore, nothing says that you can’t decide to focus on the parts and not on any whole framework. Sometimes, it’s better to find small tools and utilities instead of something completely encompassing.&amp;#160; The key though is to just decide and don’t be afraid to change if you need to later.&amp;#160; People can still make a name for themselves and still seek individuality within and outside of a company and community.&amp;#160; The secret is to strive for the collective of a given company to form their own group identity for when that happens, individual styles will merge and anything is possible.&lt;/p&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/09/paradox-of-choice-for-programmer.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcaA0UgWCj1rQF06seChi8kADXfaAQKyl42dgAW1oqfsYyZBSGLKanIAAR8BNMwq9x3TE1jKtTUSqZaJ58_4NZanxK4kUAftVauuC_LG-TObZc69zUWuiJbqll-plv8btn-5gPSjNLjik/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-6354988628445846192</guid><pubDate>Sun, 22 Aug 2010 04:36:00 +0000</pubDate><atom:updated>2010-08-21T23:39:48.189-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Commentary</category><title>Social Media - The Way of Becoming Antisocial</title><description>I&#39;ll get back to the code-related posts shortly; however, right now I just want to type something up that has been on my mind recently.  I&#39;ve been looking at the affects Social Media streams have been used by different people and entities while also watching the trends of other industries.  Quite frankly, I&#39;m scared what the future holds.  In my opinion, social media gives people a false sense of connectivity to people and popularity.  Seriously, do YOU truly care how many followers you have on Twitter or how many friends you have on MySpace or Facebook? How often do you meet those same people in person and under what occasions brings such a true in-person interaction?&lt;br /&gt;
&lt;br /&gt;
I use Twitter for a lot of fast questions and to get information on the career aspect of my life.  I use it, and thus the people I follow, more for their collective humor and knowledge than to really have conversations about their kids or their ailing relatives.  Facebook I use for more personal reasons to keep in touch with friends I&#39;ve made over the years that have moved away...people I miss and always want to share a pint with whenever I&#39;m in their city.  Sure there&#39;s a few local people I follow in both streams but the ratio is more in favor of distant friends.&lt;br /&gt;
&lt;br /&gt;
Before the land of social media grew greater than IRC, IM, and Email, I loved getting a bunch of people from work, school, and from wherever and have a great time with a lan-party or a bar-b-que.  Back then it was Warcraft II, Quake II/III, UT, and Starcraft.  The days were great.  Now look at the current game scene...the amount of co-op games are few and even Starcraft II doesn&#39;t (currently) offer LAN support.  Playing over the internet is great but there&#39;s something to be said about sharing beers and obscenities with the person on the other side of the table who just killed you in the game.&lt;br /&gt;
&lt;br /&gt;
How well do the people you connect with know you?  How well do you allow them to know you?  The people you work with will always fall under those you&#39;d go out for a beer after work with and those you wouldn&#39;t.  These are people you work with and interact with every work day...assuming you don&#39;t work remotely.  Now a days there&#39;s a lot of people who say you should always manage your personal brand online and not ask stupid, &quot;n00b&quot; questions online or reveal some embarrassing facts and what not.  These are things you can&#39;t really hide in person because such things affect our personality. If you only talk to people online and pretend your a genius, what happens when they find out your a fraud?&lt;br /&gt;
&lt;br /&gt;
Social media has a place but a person still needs the in-person interactions.  The trust you get from such is better than anything else you can get from just the 1&#39;s and 0&#39;s that come over the wire.  A couple years ago I was told by a complete stranger (to me) that my grandfather was one of the greatest people he ever knew; the most honest and genuinely good person that this person had ever known supposedly.  I don&#39;t doubt this stranger&#39;s opinion of my grandfather; however, it still makes me hope that I can live up to social precedence that my grandfather placed on this one person that effected him so much that he had to relay such information to a grandson he just met.  Do you think ANY of your friends on Facebook or Twitter or MySpace will ever relay that information if they met one of your relatives?  I truly don&#39;t know how it&#39;s even possible.</description><link>http://randomactsofcoding.blogspot.com/2010/08/social-media-way-of-becoming-antisocial.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-2337768860194678750</guid><pubDate>Thu, 24 Jun 2010 00:33:00 +0000</pubDate><atom:updated>2010-06-23T19:33:43.137-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Commentary</category><title>And Now For Something Completely Different</title><description>It&#39;s been a crazy past couple of months.  Between all but reaching the point of burning out and having some family things I had to focus on, I was stretched pretty thin and had to make some cuts in my routine.  From such, I have some ended up with some interesting observations and frustrations that has me changing my focus for this blog and my own pet project stuff.  Some of these changes will lead to a lot of fun projects while others may piss off a few people.  Hopefully, these changes will help inspire me to keep working on some new projects and to keep fueling the blog with some new content.  &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;So What&#39;s New?&lt;/h3&gt;First thing&#39;s first...I&#39;m turning into a Mac guy.  After over 2 decades of using PCs, I ended up transitioning to a Mac over this past month.  I have used Apple IIs and early Macs back in the day but those don&#39;t compare to the Macs of today obviously.  After using my new MacBook Pro for a while, I may be completely changing everything to use my Mac.  This means all of my personal .net development will more than likely be exclusively Mono-based.  This leads to some interesting opportunities about not using Visual Studio or even Windows and has been a fairly painless transition thus far.&lt;br /&gt;
&lt;br /&gt;
More things that the Mac opens up is that it provides a great platform for branching out to other platforms; namely Python, Ruby, Java, and mobile development.  Yes I could do all of the same development on a Windows box; however, there are some tools and issues I&#39;ve had in the past.  In addition, if I was on a Windows box, I&#39;d be tempted to use IronPython or IronRuby more.  I like those languages from the little bit that I&#39;ve played with them; however, I&#39;m a firm believer that fundamentals are sometimes better than abstractions.  So I&#39;m going to be focusing on using the core languages first and then integrate the Iron* languages into my dev work later.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Why New Languages?&lt;/h3&gt;I used to be a Java developer years ago.  Around the time .Net came out is when I transitioned into the MS world more whole heartedly.  I&#39;m working on getting back to my roots while expanding my knowledge into other realms.  Over the past handful of years, I&#39;ve seen the MS-related communities change in a way that, in my opinion, isn&#39;t good.  A lot of this has been described by other people but from my own personal experience, I feel like the MS-related communities are like the subdued humans in Apple&#39;s famous 1984 commercial.  It feels like as a community, the status quo has turned into going someplace and being told about a product that was released by MS.  I&#39;m guilty of falling into a trap as both a presenter and an observer.  I would go to use groups and conferences and sit and listen while someone talked about the latest technology provided by MS.  As a presenter, I was the one who put on the dog and pony show for the Managed Extensibility Framework.  This blog is a testament to my own hypocrisy.  &lt;br /&gt;
&lt;br /&gt;
The issue that I have with this model is that it seems that over the past two years, almost everything has turned into one large non-commissioned marketing machine for the Microsoft way of doing things.  I used to be all about Silverlight but now I can&#39;t look at it without feeling that it&#39;s a web-hosted version of VB6.  I would love to say that I was excited to see ASP.Net MVC when it was released; however, around that same time, I was beginning to experiment with Rails and Django.  Even to this day, the latest version of ASP.Net MVC doesn&#39;t really hold a candle to those frameworks.  Yes there are some major differences in the foundations of those platforms; however, even from a feature perspective, the MS stack is lacking. In short, I feel that Rails and Django are significantly better platforms for developing web-based solutions than the MS provided stack.  &lt;br /&gt;
&lt;br /&gt;
Admittingly, I haven&#39;t looked too far outside of the MS stack myself.  I looked at using nDjango and it was a huge change for a common VB or C# dev.  I haven&#39;t looked at FubuMVC, Spring.Net nor MonoRail so these solutions may fill in the holes during my feature comparison.  Even if these other open-source .net frameworks allow for better, faster, cheaper web development; there are still a lot of things that just doesn&#39;t exist in the MS space.  The largest one being a package management system but it&#39;s not the only one.&lt;br /&gt;
&lt;br /&gt;
Solution frameworks &quot;measuring&quot; aside, the community is beginning to concern me more and more every month.  The perceptions are skewed.  Mine was and to an extent, still is.  I used to think that anyone who presents or has a blog is a super star.  I have been called such; however, I assure you, I&#39;m not.  I started this blog and began to do speaking because I love to talk about technologies but also to provide an outlet to learn better.  When I was doing Java development close to a decade ago, the community seemed more about helping each other and swapping war stories on how a developer fixed a given situation.  I&#39;ve never had that feeling at any .net function I&#39;ve been to outside of an open space slot at a conference and even those are a crap shoot sometimes.  The dialog between community members feels very limited.  Twitter has been great for bouncing ideas and getting help to questions but applying such to a bunch of developers in a room at a conference seems to be difficult.  Participation for such open discussions, round tables, and dojos seems to paralyze people.  This is concerning.  &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;So What Am I Going to Do About it?&lt;/h3&gt;I was told a long time ago to not bitch about something unless you offer a solution or at least some way to possibly change/improve what you&#39;re bitching about.  To that end, I&#39;m dramatically reducing my .Net coding outside of my day job.  I want to learn more about other communities and languages and techniques.  I learned a ton when I was playing around with Rails and Django years ago and, to a more MS extent, Subsonic. I want to continue learning such so that I can help apply those ideas back into my day job, my presentations to user groups and conferences, and of course this blog.  If anything, more hybrid projects will come from such.  I fully support mixing languages in solutions in order to take advantage of each language&#39;s strength.  I have started working on a project that is utilizing HTML5, C#, F#, an Object Database, and IronRuby (for testing).  This isn&#39;t something you&#39;d see in today&#39;s .net ecosystem and it&#39;s not really advocated much by those who are doing MS&#39;s marketing.  I&#39;d love to see it in the wild but it&#39;s a far stretch for a number of reasons.  Regardless, I&#39;m going to be working on seeing about applying different concepts across the languages and see how things go.&lt;br /&gt;
&lt;br /&gt;
So stay tuned.  There&#39;s a lot of new stuff that&#39;s going to be coming down the pipe shortly and it&#39;ll truly be fairly random.</description><link>http://randomactsofcoding.blogspot.com/2010/06/and-now-for-something-completely.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-4168784977792208472</guid><pubDate>Sat, 15 May 2010 17:36:00 +0000</pubDate><atom:updated>2010-05-15T12:36:00.120-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Resources</category><category domain="http://www.blogger.com/atom/ns#">Reviews</category><title>My Thoughts on Pex</title><description>&lt;p&gt;Earlier this week at work I got an email asking me to install &lt;a href=&quot;http://research.microsoft.com/en-us/projects/pex/&quot; target=&quot;_blank&quot;&gt;Pex, Microsoft Research&#39;s White box Unit Testing framework for .Net&lt;/a&gt;.&amp;#160; While my company falling into the &amp;quot;early adopter&amp;quot; category (we&#39;re already on .Net 4 and VS2010), this one surprised me since it&#39;s a Research project.&amp;#160; I briefly looked into Pex last fall and didn&#39;t get too into it since I was content working with NUnit and my current unit testing tools.&amp;#160; Now that it appears that I may be using it to some extent at work, I decided to take a more meaningful look at it.&lt;/p&gt;  &lt;div style=&quot;display: inline; float: left&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQbIzswbAXZp4YxSVBlSHkVcW4duruxFEzqEE83cfbID0BQVTjWgVdYb1Vsd8pxCdXIe2NPJ3IbGAd5DMPmCzbplzmI79o5ofk7nF9kQLV7JJ0fBFU0chbLLwmnEnl-Mu7FIxvjZLu8-M/s1600-h/pexweb%5B2%5D.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; border=&quot;0&quot; alt=&quot;pexweb&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvx-OUVbDYMq-6E9m9JCsKtZ8K_9zerYLy2qZMLYV1Ni8MMdqtCA9AIV8ZxxmF_mX8jektQn0tP4zShA-k4RT5oDiZGpld4HD9swqvVMfIkhpg-97RHsivv2sxAR-bCSAPg0FIrCAZ110/?imgmax=800&quot; width=&quot;204&quot; height=&quot;125&quot; /&gt;&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;Like I said previously, Pex is a MS Research project for doing White Box Unit Testing in .Net.&amp;#160; White Box unit testing means that the tests are focused to cover the current code.&amp;#160; This is one of the shining aspects of Pex; it will scan the code to be tested and generate unit tests that cover all logical paths within it.&amp;#160; This is a great way to bring your code coverage up if you aren&#39;t getting the coverage rate with your traditional habits.&amp;#160; After Pex scans and tests the code, you can drill into the tests themselves as well as the results.&amp;#160; Pex allows you to update your own code with conditions specific for code under test too.(e.g. Pex can add null argument validation code if you so desire)&amp;#160; When everything is all set with the tests that have ran, you can save them out into a separate or existing project so that they can be ran again later. In addition to all of these things, Pex comes wired up and ready to use an assortment of Unit Testing frameworks beyond MSTest so that it can play nicely with your existing tests and test runners also.&lt;/p&gt;  &lt;p&gt;While those elements are awesome and helpful, there are a few things that turn me off of the framework.&amp;#160; Pex will dive into all dependencies found with in the code under test.&amp;#160; Where you traditionally may mock or stub out a dependency, if there&#39;s a hard dependency found, Pex will dive into it.&amp;#160; Now, this can be averted using some form of IoC container or Isolation Framework (more on this below); however, if you don&#39;t use one of these, that code will be tested as well.&amp;#160; In addition, Pex only tests Publicly exposed code.&amp;#160; If your code is marked as anything other than public, Pex will inform you that it can&#39;t test it.&amp;#160; This doesn&#39;t bode well for software businesses who have a lot of internal classes.&amp;#160; During my tests, I even tried to use the InternalsVisibleTo assembly attribute and it still wouldn&#39;t work with it.&amp;#160; Lastly, I was a bit disappointed in Pex only scans the currently active file inside of the IDE.&amp;#160; While there&#39;s a command line way of running Pex, supposedly, from within Visual Studio itself, Pex can only work with 1 file at a time.&lt;/p&gt;  &lt;p&gt;Finally, Pex has this nice little buddy called Moles.&amp;#160; Moles is an isolation framework for handling dependencies.&amp;#160; You can use either without Pex; however, they are closely tied together from a project and documentation standpoint (if you find info on Moles, you&#39;ll almost always find info on Pex and visa versa).&amp;#160; Moles focuses on generating Stubs in the same way as frameworks like &lt;a href=&quot;http://www.ayende.com/projects/rhino-mocks.aspx&quot; target=&quot;_blank&quot;&gt;Rhino Mocks&lt;/a&gt; and &lt;a href=&quot;http://www.nmock.org/&quot; target=&quot;_blank&quot;&gt;NMock2&lt;/a&gt;; however, it also has what it calls Mole objects which focus on Sealed, Static, and or Privately scoped classes.&amp;#160; I did not dive too deep into Moles; however, it would appear that it does not mock these types but rather intercept and detour the method calls into the implementations you wire up. From my understanding this is similar to how &lt;a href=&quot;http://site.typemock.com/&quot; target=&quot;_blank&quot;&gt;TypeMock&lt;/a&gt; handles the same task.&lt;/p&gt;  &lt;p&gt;Overall, I think Pex is a good product for people trying to get their code coverage up and are in a Test-Last mentality.&amp;#160; It works great under that situation and makes for a great candidate for automating unit test generation of DTO/Domain Model classes that tend to be public due to how they get passed around and usually consist of just getters and setters.&amp;#160; It&#39;s not a tool I see myself using personally, though.&amp;#160; I&#39;m human and can see a very difficult argument in justifying a Test-First approach beyond design when Pex can/will write the tests for you.&amp;#160; Applying that logic to a business environment and justifying a few minutes to write some tests to a manager vs a few seconds to run Pex and generate more tests is a hard sell.&lt;/p&gt;  </description><link>http://randomactsofcoding.blogspot.com/2010/05/my-thoughts-on-pex.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvx-OUVbDYMq-6E9m9JCsKtZ8K_9zerYLy2qZMLYV1Ni8MMdqtCA9AIV8ZxxmF_mX8jektQn0tP4zShA-k4RT5oDiZGpld4HD9swqvVMfIkhpg-97RHsivv2sxAR-bCSAPg0FIrCAZ110/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-1594086858796481761</guid><pubDate>Sat, 15 May 2010 15:34:00 +0000</pubDate><atom:updated>2010-05-17T08:06:03.562-05:00</atom:updated><title>Iowa Code Camp - Spring &amp;#39;10 Review</title><description>&lt;div style=&quot;display: inline; float: right&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7aweZv5GHlNRCsPSnqHOgZilJ1jcibgcW7v8iBuN8uJmDkMglMYSAFeZ0MfKI8Sh3pchDxlUCFgN1RCXPfC4-1kJhp8qSu2P09enFmIJI-MhC25xh_kDDmi_BSAq9zrSH7f4svRhmtT4/s1600-h/icc_logo%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px&quot; border=&quot;0&quot; alt=&quot;icc_logo&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsCNec078_iiNfzODLQ19Iu5-uxE8XBcNCK9i1vDIFX1_lrHFgIwibtwKyuOsYHNsA374KREO1hHIrzsBtdgYU6jediBPPWXRzamZL_yOQoMLCRBmBDJB3p__9SESrzcq9G3eil9DWPBI/?imgmax=800&quot; width=&quot;482&quot; height=&quot;134&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Back on the first of May, many from the .Net community in the Midwest flocked to Iowa City, IA in order to attend the &lt;a title=&quot;Iowa Code Camp Home Page&quot; href=&quot;http://www.iowacodecamp.com/&quot; target=&quot;_blank&quot;&gt;Iowa Code Camp&lt;/a&gt;.&amp;#160; For those that aren&#39;t aware, Code Camps are community driven events where speakers volunteer to give presentation on a variety of topics for people to come and learn.&amp;#160; The Iowa Code Camp happens twice a year and every time it&#39;s been a great event.&lt;/p&gt;&lt;p&gt;This Spring&#39;s Code Camp saw me presenting my &lt;a title=&quot;My Presentation Slides for my talk on MEF.&quot; href=&quot;http://randomactsofcoding.blogspot.com/2010/04/my-managed-extensibility-framework-mef.html&quot; target=&quot;_blank&quot;&gt;talk on the Managed Extensibility Framework (MEF)&lt;/a&gt;.&amp;#160; The talk went fairly well in my opinion though we are our own worst critics sometimes.&amp;#160; The feedback I got on the talk was very constructive and gave me a lot of things I need to work on beyond what I was able to find from personal reflection.&amp;#160; I also ended up recording my talk using my &lt;a title=&quot;Flip MindoHD Camcorder&quot; href=&quot;http://store.theflip.com/en-us/products/MinoHD120.aspx&quot; target=&quot;_blank&quot;&gt;Flip MinoHD camera&lt;/a&gt; which works very well other then the fact that it&#39;s hard to tell how the HD video truly looks on a tiny screen.&amp;#160; If you present, I highly recommend that you record yourself either in practice and/or presentation in order to obtain additional feedback on yourself; since you know the subject matter, you&#39;ll find more things about your presentation style and quirks that many evaluation forms miss.&lt;/p&gt;&lt;p&gt;Beyond my presentation, there were 4 other time slots/talks available for me to attend.&amp;#160; This specific code camp I wanted to focus on solidifying my knowledge of topics that I have pretty much taught myself.&amp;#160; While I was very confident in my abilities with the code-related topics, I wanted to see another person&#39;s perspectives of such so that I can gauge my own understanding and learn a few new tips as well.&amp;#160; Below is a rundown of the sessions I attended:&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3&gt;IoC with StructureMap - By Brad Tutterow&lt;/h3&gt;&lt;p&gt;Inversion of Control and Dependency Injection have been topics that some people get and some people still don&#39;t fully see the value of it.&amp;#160; I got it pretty quickly because of my TDD experience; however, am always interested to learn new things about IoC containers&amp;#160; and the patterns in general.&amp;#160; Going into this talk I figured there&#39;d be some discussion on the principles and patterns; however, there&#39;d be a lot of discussion on how to use &lt;a href=&quot;http://structuremap.github.com/structuremap/index.html&quot; target=&quot;_blank&quot;&gt;StructureMap&lt;/a&gt;.&amp;#160; What the presentation turned out to be was a jewel.&amp;#160; The polished presentation focused probably 75% on IoC and DI with the last 25% being about StructureMap.&amp;#160; Brad did an excellent job in not only explaining the &amp;quot;What&amp;quot; of the topics but the &amp;quot;Why&amp;quot; as well.&amp;#160; Looking throughout the audience, I could see some people finally understand it and it&#39;s importance.&amp;#160; In addition, Brad provided a great, evolving example that went from tightly coupled to decoupled to implementing StructureMap for fully handling all dependencies.&amp;#160; The time with StructureMap may have been less than I expected, but the value of the presentation as a whole completely outweighed my curiosity on the &amp;quot;How&amp;quot;.&amp;#160; &lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3&gt;TDD Dojo - By John Teague&lt;/h3&gt;&lt;p&gt;I&#39;ve been unit testing my own code on side projects for a while now.&amp;#160; I don&#39;t always push them in my blog post examples (I should though; I know); however, seeing a true TDD with pair programming session was something I wanted to observe and partake in.&amp;#160; In my opinion, a person&#39;s adoption rate of TDD and specifically Test-First is directly related to how close they are to finding that spot in Red-Green-Refactor where they write enough tests and code to feel meaningful.&amp;#160; I&#39;ve seen a lot of people get turned off with the RGR pattern and TDD&#39;s principle of doing the bare minimum because it seems too simple and impractical; however, if you can find a level between writing all of the code and writing the bare minimum, usually they begin to adopt it more.&lt;/p&gt;&lt;p&gt;This issue is one of the things I felt from John&#39;s session.&amp;#160; John&#39;s session was broken up into 2 sessions and I only stayed for the first half.&amp;#160; In the first half, there was a wide assortment of experience levels among attendees.&amp;#160; Some people have been doing TDD for a while; however, there were a number that either rarely unit test or have never unit tested at all.&amp;#160; This range made some people question to simplicity of TDD&#39;s cycles and the perception of the impracticality of it all.&amp;#160; Despite what the session abstract said, I believe people were expecting slides on how to do TDD instead of a more hands on approach...the different format, which included pairing in front of everyone, seemed to make some uncomfortable.&lt;/p&gt;&lt;p&gt;With that said though, John did a great job in handling all of the questions and comments and an even better job in helping people pair up and begin to get familiar with TDD.&amp;#160; It was really good to see a &lt;strike&gt;talk&lt;/strike&gt; session in a different format and a practical flow.&amp;#160; It was really good to see how attendees who finished their pairing time to come back with a &amp;quot;I get it&amp;quot; look on their face.&amp;#160; &lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3&gt;Open Session&lt;/h3&gt;&lt;p&gt;There were no open sessions on the schedule for Iowa Code Camp this time around.&amp;#160; I had every intent to continue with John&#39;s Dojo for the second half; however, a few of my friends were in the session had never written a unit test and were a bit overwhelmed.&amp;#160; When I ended up doing instead is taking one aside and worked with him on a one on one basis to help him understand unit testing, in general, a bit better.&amp;#160; One thing I wanted to make sure though was to use the same frameworks that John used in the first half of his Dojo since he covered the basics of seeing up a test class and test methods. The developer I worked with absorbed these aspects of John&#39;s session; however, was having a hard time seeing how to apply it.&amp;#160; For example: show a person who&#39;s never unit tested a test that validates a method returns true is great; however, they tend to get lost in the practicality of the test when the method body just reads &amp;quot;return true;&amp;quot;.&amp;#160; I worked with him on an example of splitting a paragraph into various lines after a certain length, ensuring words were not broken as well.&amp;#160; My example was well; however, I didn&#39;t do so well on demonstrating stuff.&amp;#160; Towards the end though, he had written his first couple unit tests though and saw it working.&amp;#160; Now for me to go through more katas myself - practice makes perfect right?&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3&gt;Being a Technology Entrepreneur - By Scott Davis&lt;/h3&gt;&lt;p&gt;This session was packed. I&#39;ve looked into doing some side projects and freelance work in the past and this talk helped provide some insight on how I should go about doing such correctly from the start in the event that I wanted to go from simple freelancing to turning it into a true business.&amp;#160; Scott&#39;s advice was fantastic and the information he provided on the types of things to be mindful of was invaluable.&amp;#160; He kept everything relevant from things you should do when dealing with an attorney or accountant to what and how long it takes to setup a business with your local state.&amp;#160; His information on what types of businesses you should be looking at as well as how companies like Microsoft can help out as well.&amp;#160; Scott&#39;s talking again at the Kansas City Developers Conference in June and I may be attending the talk again since I know there&#39;ll be more things I didn&#39;t pick up on the first time around.&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3&gt;Learning Distributed Source Control with Mercurial - By Chris Sutton&lt;/h3&gt;&lt;p&gt;Chris was kind enough to allow me record his talk despite the fact that I went to a different session (Thanks again, Chris!).&amp;#160; I have very little knowledge of Mercural (Hg) or Git so I was hoping to attend a talk on one of these while there; however, there were so many good sessions I had to resort to my recording.&amp;#160; Chris did a great job on presenting Hg.&amp;#160; He provided a great explanation of distributed version control systems and how they different from more traditional options like Subversion or Team Foundation Server.&amp;#160; His examples showed how to use Hg in a variety of tasks.&amp;#160; There were a lot of good questions during the discussion in terms of branching, merging, and comparisons which Chris fielded very well.&amp;#160; This talk wanted me to move all of my code to a dvcs instead of the systems I&#39;ve been using up to this point.&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3&gt;Reflections&lt;/h3&gt;&lt;p&gt;After looking over my notes and the conversations I had surrounding the event; I wish it was longer.&amp;#160; Being able to bounce ideas from other developers and also focus on ways to make the event better was great.&amp;#160; Everyone involved in putting on the event was fantastic and for that Thank You!&amp;#160; I&#39;m looking forward to (at least) attending the next Iowa Code Camp in November and see what may come from that.&lt;/p&gt;&lt;p&gt;Outside of the great event, there were a lot of things that I noticed.&amp;#160; The talks with the most interest were associated with either mobile development or Scott&#39;s Entrepreneurship talk.&amp;#160; Mobile is a hugely hot topic in the industry and the entrepreneurship talk&#39;s attendance matches what I&#39;ve been seeing on Twitter and other conversations.&amp;#160; There seems to be a desire for information on how to be better outside of the code.&amp;#160; This is not to say that there should be talks on how to be a manager; however, how to be better at business, interactions with others, and skills that are important but not about really writing code.&amp;#160; I&#39;ve been seeing this for a while; however I&#39;m seeing the trend increase for things like Scott&#39;s talk as well as &lt;a href=&quot;http://brianhprince.com/&quot; target=&quot;_blank&quot;&gt;Brian H. Prince&#39;s&lt;/a&gt; Soft Skills talk.&lt;/p&gt;&lt;p&gt;In addition, I noticed the experience gap.&amp;#160; Now, I&#39;m not expecting everyone to be super star developers; however, I see a need for something additional to be made available to help those understand concepts they may not fully understand before or even after a topic.&amp;#160; There isn&#39;t a magic bullet that provides the solution to this, but it&#39;s something that I am brainstorming on.&amp;#160; Should there be a 100% open spaces track dedicated to &amp;quot;mentoring&amp;quot; and helping people out with different topics or projects than just a discussion of random things like some open spaces turn into?&amp;#160; Should there be prerequisites suggested for every session?&amp;#160; Am I actually just imagining this gap?&lt;/p&gt;&lt;p&gt;Lastly, this code camp brought a lot of insight into myself.&amp;#160; After seeing the presentations and also &lt;a href=&quot;http://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action.html?awesm=on.ted.com_8IbV&amp;amp;utm_campaign=simon_sinek_how_great_leaders_inspire_action&amp;amp;utm_medium=on.ted.com-twitter&amp;amp;utm_source=direct-on.ted.com&amp;amp;utm_content=ted.com-talkpage&quot; target=&quot;_blank&quot;&gt;this TED talk on how leaders inspire action&lt;/a&gt;, I&#39;m going to be changing my MEF presentation around a lot. Brad did a great job in his presentation in building an understanding of why things are important and why he&#39;s passionate about such.&amp;#160; This is something that I felt was lacking from my presentation.&amp;#160; In addition, I&#39;m hoping to get more involved in the near future.&amp;#160; Do I know specifically what that means, no but that&#39;s the beauty of community, people can fill where the need is.&amp;#160; In addition, I may be moving my presentation focus away from tools and into a more community focused array of topics; like Interviewing Skills, getting involved in Open Source Software, and ways to become a better developer and getting involved in the community.&amp;#160; Needless to say, there&#39;s no shortage of things I can improve upon with in myself and my abilities.&amp;#160; I can&#39;t wait to see how I&#39;ll grow and be ready for the next Iowa Code Camp.&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;h3&gt;Contact Information:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.iowacodecamp.com&quot; target=&quot;_blank&quot;&gt;Iowa Code Camp&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.lostechies.com/blogs/johnteague/default.aspx&quot; target=&quot;_blank&quot;&gt;John Teague&lt;/a&gt; - (Twitter: &lt;a href=&quot;http://twitter.com/john_teague&quot; target=&quot;_blank&quot;&gt;@john_teague&lt;/a&gt;) &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.codebadger.com/blog/&quot; target=&quot;_blank&quot;&gt;Brad Tutterow&lt;/a&gt; - (Twitter: &lt;a href=&quot;http://twitter.com/codebadger&quot; target=&quot;_blank&quot;&gt;@codebadger&lt;/a&gt;) &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://subjunctive.us/&quot; target=&quot;_blank&quot;&gt;Chris Sutton&lt;/a&gt; - (Twitter: &lt;a href=&quot;http://twitter.com/chrissutton&quot; target=&quot;_blank&quot;&gt;@chrissutton&lt;/a&gt;) &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ignitionpointsolutions.com/&quot; target=&quot;_blank&quot;&gt;Scott K Davis&lt;/a&gt; - (Twitter: &lt;a href=&quot;http://twitter.com/scottkdavis&quot; target=&quot;_blank&quot;&gt;@scottkdavis&lt;/a&gt;) &lt;/li&gt;
&lt;/ul&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/05/iowa-code-camp-spring-review.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsCNec078_iiNfzODLQ19Iu5-uxE8XBcNCK9i1vDIFX1_lrHFgIwibtwKyuOsYHNsA374KREO1hHIrzsBtdgYU6jediBPPWXRzamZL_yOQoMLCRBmBDJB3p__9SESrzcq9G3eil9DWPBI/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-2343366697394583075</guid><pubDate>Fri, 30 Apr 2010 22:30:00 +0000</pubDate><atom:updated>2010-05-03T07:53:49.097-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MEF</category><category domain="http://www.blogger.com/atom/ns#">Presentation</category><title>My Managed Extensibility Framework (MEF) slides from the Iowa Code Camp</title><description>Below are the slides I gave at the Iowa Code Camp on May 1st in Iowa City, IA.  &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;width:425px&quot; id=&quot;__ss_3924559&quot;&gt;&lt;strong style=&quot;display:block;margin:12px 0 4px&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/JamesEggers/mef-12-step-program&quot; title=&quot;Mef 12 step program&quot;&gt;Mef 12 step program&lt;/a&gt;&lt;/strong&gt;&lt;object id=&quot;__sse3924559&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mef12stepprogram-100430172648-phpapp01&amp;stripped_title=mef-12-step-program&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed name=&quot;__sse3924559&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mef12stepprogram-100430172648-phpapp01&amp;stripped_title=mef-12-step-program&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;padding:5px 0 12px&quot;&gt;View more &lt;a href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/JamesEggers&quot;&gt;JamesEggers&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h3&gt;Demo Projects&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://cid-3cb659da2d58facb.skydrive.live.com/self.aspx/Public/MEF%20Examples/MEF%20Presentation%20Demos%20v1.zip&quot;&gt;Visual Studio 2008 MEF Demo Projects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://dotnetmigrations.codeplex.com&quot;&gt;Dot Net Migrations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/04/my-managed-extensibility-framework-mef.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-4198101354226582327</guid><pubDate>Thu, 15 Apr 2010 01:31:00 +0000</pubDate><atom:updated>2010-04-14T20:31:32.628-05:00</atom:updated><title>Hiding Parts From InheritedExport</title><description>&lt;p&gt;In a previous post in my ongoing series on the Managed Extensibility Framework (MEF) I discussed using the &lt;font face=&quot;Courier&quot;&gt;InheritedExportAttribute&lt;/font&gt; in order to simply export declarations throughout a class hierarchy.&amp;#160; This attribute can be applied to either an Interface or a base class.&amp;#160; However, what if you wanted to implement the interface or inherit from the decorated base class (either directly or indirectly) but didn&#39;t want this new derived class to be imported during composition?&amp;#160; Thankfully, the designers of MEF thought of this issue and created the &lt;font face=&quot;Courier&quot;&gt;PartNotDiscoverableAttribute&lt;/font&gt;.&amp;#160; This attribute is very straightforward; simply place it on the part you wish to exclude and MEF will ignore it.&lt;/p&gt;  &lt;h3&gt;Post Links&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href=&quot;http://cid-3cb659da2d58facb.skydrive.live.com/self.aspx/Public/MEF%20Examples/MEFExample10.zip&quot; target=&quot;_blank&quot;&gt;Example Source Code&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href=&quot;http://randomactsofcoding.blogspot.com/2009/11/working-with-managed-extensibility.html&quot; target=&quot;_blank&quot;&gt;MEF Series Table of Contents&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  </description><link>http://randomactsofcoding.blogspot.com/2010/04/hiding-parts-from-inheritedexport.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-75461726939377654</guid><pubDate>Thu, 15 Apr 2010 01:01:00 +0000</pubDate><atom:updated>2010-04-15T08:18:40.353-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">MEF</category><title>Using MEF with Signed Part Assemblies</title><description>&lt;p&gt;Over the past few months, I&#39;ve been giving a number of presentations over the Managed Extensibility Framework. Every time I&#39;ve given the presentation, the same question has came up - &amp;quot;How was signed assemblies and security factor into MEF?&amp;quot;.&amp;#160; Ultimately, I didn&#39;t have an answer at that time since my experience with the need to do assembly signing has been limited, and my perception is very trusting when it comes to plug-ins and extensibility.&amp;#160; Regardless, I don&#39;t like not having an answer on a subject I&#39;m presenting/teaching.&amp;#160; So, in this post, we&#39;ll look at the challenges that exist to ensure that any assemblies that contains parts is signed and how to control composition of those assemblies in your MEF-enabled application.&lt;/p&gt;&lt;h3&gt;Important Links&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a title=&quot;MEF Assembly Security Example Code&quot; href=&quot;http://cid-3cb659da2d58facb.skydrive.live.com/self.aspx/Public/MEF%20Examples/MEFAssemblySecurity.zip&quot; target=&quot;_blank&quot;&gt;Example Source Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://randomactsofcoding.blogspot.com/2009/11/working-with-managed-extensibility.html&quot; target=&quot;_blank&quot;&gt;MEF Series Table of Contents&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;How To Check If An Assembly Is Signed?&lt;/h3&gt;&lt;p&gt;While I have said that my experience with signed assemblies has been limited, I have always created or consumed signed assemblies.&amp;#160; This was great when adding references but the point of using MEF is to ensure we don&#39;t have to add references and recompile.&amp;#160; How do I check if an assembly is signed without having to add a reference and recompile the code?&amp;#160; After doing a little digging, I wrote the following unit test:&lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;[Test]&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Check_Unsigned_Assembly()&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    var assembly = Assembly.GetExecutingAssembly();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;    Assert.IsEmpty(assembly.GetName().GetPublicKey());&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;[Test]&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Check_Signed_Assembly()&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;    var assembly = Assembly.LoadFile(ASSEMBLY_ONE_PATH);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;    Assert.IsNotEmpty(assembly.GetName().GetPublicKey());&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;p&gt;In the first test we are loading the test assembly which isn&#39;t signed; however, the second test uses a signed assembly. In these tests we are checking the assemblies&#39; &lt;font face=&quot;Courier&quot;&gt;AssemblyName&lt;/font&gt; by calling &lt;font face=&quot;Courier&quot;&gt;GetName()&lt;/font&gt; and then &lt;font face=&quot;Courier&quot;&gt;GetPublicKey()&lt;/font&gt;.&amp;#160; If the &lt;font face=&quot;Courier&quot;&gt;PublicKey&lt;/font&gt; values, which is a byte array (&lt;font face=&quot;Courier&quot;&gt;byte[]&lt;/font&gt;), is empty, then the assembly is not signed.&amp;#160; That&#39;s easy; however, if 2+ assemblies are signed with the same &lt;font face=&quot;Courier&quot;&gt;.snk&lt;/font&gt; file are compared, do they have the same &lt;font face=&quot;Courier&quot;&gt;PublicKey&lt;/font&gt; value?&lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;[Test]&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Check_Signed_Assemblies_For_Same_Key()&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    var assembly1 = Assembly.LoadFile(ASSEMBLY_ONE_PATH);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    var assembly2 = Assembly.LoadFile(ASSEMBLY_TWO_PATH);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;    CollectionAssert.AreEqual(assembly1.GetName().GetPublicKey(), &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;                                assembly2.GetName().GetPublicKey());&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;p&gt;Short answer....yes, the keys are the same.&amp;#160; Now that we know how to test for signed assemblies and know that assemblies that are signed with the same key have the same &lt;font face=&quot;Courier&quot;&gt;PublicKey&lt;/font&gt; byte array value, let&#39;s look at how we can push this into our MEF-ed out application.&lt;/p&gt;&lt;h3&gt;Validating Part Assemblies Are Signed&lt;/h3&gt;&lt;p&gt;There are a few ways we can apply the logic we explored using the unit tests above. We could loop through a directory of assemblies and validate the assemblies prior to adding each one as the target of an &lt;font face=&quot;Courier&quot;&gt;AssemblyCatalog&lt;/font&gt; for an &lt;font face=&quot;Courier&quot;&gt;AggregateCatalog&lt;/font&gt;.&amp;#160; Ideally, we would probably want to wrap that logic as a custom, extended catalog in order to make it reusable if this is something you&#39;ll need more often.&amp;#160; For this demo though, let&#39;s just keep everything local to our application through the below method:&lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Compose()&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;    var key = Assembly.GetExecutingAssembly().GetName().GetPublicKey();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    var catalog = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AggregateCatalog();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;    catalog.Catalogs.Add(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AssemblyCatalog(Assembly.GetExecutingAssembly()));&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;    var dir = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; DirectoryInfo(&lt;span class=&quot;str&quot;&gt;&amp;quot;Plugins&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    Assembly assembly;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;foreach&lt;/span&gt; (var file &lt;span class=&quot;kwrd&quot;&gt;in&lt;/span&gt; dir.GetFiles(&lt;span class=&quot;str&quot;&gt;&amp;quot;*.dll&amp;quot;&lt;/span&gt;))&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;        assembly = Assembly.LoadFile(file.FullName);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;byte&lt;/span&gt;[] assemblykey = assembly.GetName().GetPublicKey();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;        &lt;span class=&quot;rem&quot;&gt;// custom compare method&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (ArraysEqual(key, assemblykey))&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  18:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  19:  &lt;/span&gt;            catalog.Catalogs.Add(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; AssemblyCatalog(assembly));&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  20:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  21:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  22:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  23:  &lt;/span&gt;    var container = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; CompositionContainer(catalog);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  24:  &lt;/span&gt;    container.ComposeParts(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  25:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;p&gt;In this method, we&#39;re adding &lt;font face=&quot;Courier&quot;&gt;AssemblyCatalogs&lt;/font&gt; into an &lt;font face=&quot;Courier&quot;&gt;AggregateCatalog&lt;/font&gt; only if a located assembly is signed. If the assembly is not signed, we&#39;re not going to load it for this particular composition.&amp;#160; Other parts of the application may use all assemblies but for this method, we only want to be signed assemblies that have the same key as the executing assembly.&amp;#160; Sounds simple enough, right? Well, there are a few things you need to do to make this work.&lt;/p&gt;&lt;h3&gt;A Caveat to Implementation&lt;/h3&gt;&lt;p&gt;The first thing I ran into when I tried to implement this with MEF Preview 9 out on Codeplex was that the MEF assembly isn&#39;t signed.&amp;#160; This wouldn&#39;t be an issue except for the fact that any signed assemblies cannot reference unsigned assemblies. So, if you expose a public assembly that contains a custom &lt;font face=&quot;Courier&quot;&gt;ExportAttribute&lt;/font&gt; or a base class/interface that is decorated with the &lt;font face=&quot;Courier&quot;&gt;InheritedExportAttribute&lt;/font&gt;, you&#39;ll need to have that assembly signed so it can be used by those extending the application.&amp;#160; Since that assembly is going to be signed, then it needs a signed version of MEF.&amp;#160; It&#39;s a vicious cycle. Once you have your core application signed (since it needs to referenced your signed public assembly), you&#39;re good to go.&amp;#160; In the accompanying C# project, I created a signed version of the MEF Preview 9 source and referenced it in each project that needed such.&lt;/p&gt;&lt;h3&gt;Summary&lt;/h3&gt;&lt;p&gt;While this is more proof of concept code, it hopefully illustrates what can be done in order to verify not only how to selectively load assemblies that contain MEF parts based on if they are signed or not as well as dependent on the key too.&amp;#160; Like I said before, the above code could be refactored into a custom and/or extended catalog in order to simplify the logic in the Compose() method as well as advocate reusability. &lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Update:&lt;/h3&gt;&lt;p&gt;After passing this post around, I was informed that checking to see if the assembly is signed with a public key and/or that if the key matches an existing key is not enough for security sake.  To take it another step further, please check out the below blog post by Andreas H&amp;#0229;kansson (The Code Junkie) that describes how to test for a strong name as well.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.thecodejunkie.com/2008/11/checking-assembly-for-strong-name-and.html&quot; title=&quot;Checking An Assembly for a Strong Name and Specific Public Key&quot;&gt;Checking An Assembly for a Strong Name and Specific Public Key - By Andreas H&amp;#0229;kansson (The Code Junkie)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_url = &#39;http://randomactsofcoding.blogspot.com/2010/04/using-mef-with-signed-part-assemblies.html&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_title = &#39;Using MEF with Signed Part Assemblies&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_blurb = &#39;In this post on my ongoing series on the Managed Extensibility Framework, I answer a question that has came up during my live presentations concerning how to ensure composition is only handled for signed assemblies.&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_style = &#39;2&#39;;&lt;/script&gt;&lt;script language=&quot;javascript&quot; src=&quot;http://widgets.dzone.com/links/widgets/zoneit.js&quot;&gt;&lt;/script&gt;&lt;a rev=&quot;vote-for&quot; href=&quot;http://dotnetshoutout.com/Random-Acts-of-Coding-Using-MEF-with-Signed-Part-Assemblies&quot;&gt;&lt;img alt=&quot;Shout it&quot; src=&quot;http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Frandomactsofcoding.blogspot.com%2F2010%2F04%2Fusing-mef-with-signed-part-assemblies.html&quot; style=&quot;border:0px&quot;/&gt;&lt;/a&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/04/using-mef-with-signed-part-assemblies.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-7560818626885355887</guid><pubDate>Fri, 26 Mar 2010 20:32:00 +0000</pubDate><atom:updated>2010-03-26T15:43:23.227-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Commentary</category><title>Development Achievements</title><description>&lt;p&gt;A couple months ago, I came across &lt;a title=&quot;StackOverflow - Intern Training - Best Approach?&quot; href=&quot;http://stackoverflow.com/questions/2162749&quot; target=&quot;_blank&quot;&gt;this question over on StackOverflow&lt;/a&gt;.&amp;#160; In a nutshell, the question was wondering what people have experienced and recommend on how to go about training an intern developer.&amp;#160; I took the approach of any developer as opposed to focusing solely on an intern level person because to some degree we are all &amp;quot;that&amp;quot; person when we first joining a new company with new practices, products, and code.&amp;#160; My recommendation for that question revolved two ideas.&amp;#160; First, around training the person on the product(s) that the person would be using as if they are an end user so they have the context of the application(s).&amp;#160; The second idea was a peer programing/mentoring aspects that many of us have heard about yet not as many have experienced.&amp;#160; &lt;/p&gt;&lt;h3&gt;A Missing Piece?&lt;/h3&gt;&lt;p&gt;Since I posted my answer though, I began to feel as if there was something missing.&amp;#160; My answer to that question revolved around my own experiences as a new developer in a company as well as mentoring/training new developers that join a company that I&#39;d been at for years.&amp;#160; Something still felt like it was missing though.&amp;#160; What if the person didn&#39;t like the direction of the product/application and is uncertain about speaking up?&amp;#160; What if they are anti-unit testing when they join a team that does such?&amp;#160; How do you make sure that the developer made the right choice by accepting the offered position while providing long term motivation for more veteran developers on the team?&amp;#160; &lt;/p&gt;&lt;p&gt;These questions outlined the missing piece.&amp;#160; How to motivate and keep the people involve is a huge thing to new developers.&amp;#160; Sure regularly going out to eat for lunch with other team members can help build friendships and a sense of belonging but what if the intern&#39;s job for the first 3-6 months is doing nothing but very remedial work?&amp;#160; If I was an intern and been able to do a large amount of coding but was told to only do unit tests for the first 3-6 months at a job without the ability to truly change directions or suggest tools, I&#39;d be questioning my decision of joining the company or (if I was brand new to the industry) the career as a whole. I&#39;d probably feel that I was capable of more even if I was a bit naive.&amp;#160; We all have to do the grunt work but how do you mitigate the ceremony and monotony of the pieces that cannot be automated?&lt;/p&gt;&lt;h3&gt;Is Achievement System Possible?&lt;/h3&gt;&lt;p&gt;This got me to think about the theory of inconsistent rewards which says, in a nutshell, that inconsistently awarding rewards can lead to continued behavior.&amp;#160; This behavioral theory is what makes gambling addicting as well as the badge systems (i.e. FourSquare, StackOverflow) and achievement systems in video games work so well.&amp;#160; Could this work for developers and development teams?&amp;#160; In my opinion, yes and no.&lt;/p&gt;&lt;p&gt;In my opinion, the ability to apply an arguably meaningless recognition system together for the greater developer community with regards to experiences is impossible.&amp;#160; Yes, there are a few pieces of low hanging fruit that could be applied to just about every development shop like &amp;quot;Wrote x Unit Tests&amp;quot;, &amp;quot;Refactored x lines of code&amp;quot;, &amp;quot;Demonstrated good SOLID Practices&amp;quot;, etc.; however, those things don&#39;t truly map well beyond the basics and theories when applying such to an internal team&#39;s focus.&amp;#160; With such a low common denominator of options that could be applied across the board, I wouldn&#39;t be surprised if such acquired the same stigma of most industry certifications.&lt;/p&gt;&lt;p&gt;However, what if the focus was moved from the global scale of all developers down to an individual team or company?&amp;#160; All of the sudden you have achievements associated with adding new technologies into the company, migrating legacy code to a new platform, did X to project Y, an &amp;quot;expert&amp;quot; in project Z, and more.&amp;#160; This can turn into motivation tool in that you want to obtain those achievements as well as help identify the &amp;quot;go to&amp;quot; people on certain things.&amp;#160; If someone doesn&#39;t have the &amp;quot;wrote first unit test&amp;quot; achievement, then more than likely that&#39;s not the person you&#39;d want to talk to if you have a mocking question.&lt;/p&gt;&lt;h3&gt;What Would It Take?&lt;/h3&gt;&lt;p&gt;Looking solely at a team/company level of implementation, there are a few things that would have to be done in order to ensure that an achievement system could be implemented. First, there&#39;d have to be some place that showcases each developer&#39;s achievements.&amp;#160; What&#39;s the point of awarding something if it&#39;s not known by people?&amp;#160; This could be a bio page on SharePoint or something else.&amp;#160; Personally, I don&#39;t like hanging certifications or anything like that on my cube wall and the purpose of an achievement system would be to obtain more and more so hard copy forms of the achievement probably isn&#39;t a good idea.&amp;#160; Hard copy would also be pointless if you have remote workers.&lt;/p&gt;&lt;p&gt;Second, there needs to be a consistent method on how to evaluate if the achievements have been obtained by a person.&amp;#160; Many development teams practice peer reviewing their code in some fashion; some aspects of a peer review could be quantified and the achievement system could be based on such.&amp;#160; Things like &amp;quot;First Unit Test&amp;quot;, &amp;quot;1000th Unit Test&amp;quot;, etc. could very easily be addressed in this way; however, there should also be a way to identify details of other achievements for giving a presentation on a new technology or similar.&lt;/p&gt;&lt;p&gt;Lastly, as much as I think it could work as is, I&#39;m certain some managers in some companies who wouldn&#39;t buy the idea unless they could figure out a way to tie it into performance reviews or other process.&amp;#160; Since the idea around the system would depend on inconsistency of awarding the achievements, I don&#39;t think it&#39;d be a good idea to use such a system in a quantitative fashion; however, it could be used for qualitative analysis. If this need is present, it would ultimately turn into the needs of the team/company and what achievements they define.&lt;/p&gt;&lt;h3&gt;Ideas for Achievements&lt;/h3&gt;&lt;p&gt;Below is a list I have been thinking about that could possibly be such achievements.&amp;#160; The list isn&#39;t in any order and are more or less me thinking &amp;quot;out loud&amp;quot;.&amp;#160; A community site could be cool if the idea works though.&amp;#160; Some of the ideas here are criteria while others would be the idea/concept of what it&#39;s trying to convey.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Wrote First Unit Test&lt;/li&gt;
&lt;li&gt;Wrote X Unit Tests&lt;/li&gt;
&lt;li&gt;First Project Task Finished&lt;/li&gt;
&lt;li&gt;First Project Task Finished Without any bugs found.&lt;/li&gt;
&lt;li&gt;Project X - Novice&lt;/li&gt;
&lt;li&gt;Project X - Craftsman&lt;/li&gt;
&lt;li&gt;Project X - Veteran&lt;/li&gt;
&lt;li&gt;Language X - Novice/Craftsman/Veteran&lt;/li&gt;
&lt;li&gt;First Project in X Language&lt;/li&gt;
&lt;li&gt;Multilingual (development languages)&lt;/li&gt;
&lt;li&gt;Novice Presenter&lt;/li&gt;
&lt;li&gt;Occasional Teacher&lt;/li&gt;
&lt;li&gt;Educator&lt;/li&gt;
&lt;li&gt;Implemented Technology X first&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;This list is not all inclusive and can grow as needed.&amp;#160; I&#39;m curious to know your thoughts on the idea as a whole, what else could be considered for achievements, and what implementation issues may arise.&amp;#160; I just had the idea and figured I&#39;d throw it out here and see what people think.&lt;/p&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_url = &#39;http://randomactsofcoding.blogspot.com/2010/03/development-achievements.html&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_title = &#39;Development Achievements&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_blurb = &#39;A look at the possibility of applying an Achievement or Trophie based system into a development team.&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_style = &#39;2&#39;;&lt;/script&gt;&lt;script language=&quot;javascript&quot; src=&quot;http://widgets.dzone.com/links/widgets/zoneit.js&quot;&gt;&lt;/script&gt;&lt;a href=&quot;http://www.dotnetkicks.com/kick/?url=http%3a%2f%2frandomactsofcoding.blogspot.com%2f2010%2f03%2fdevelopment-achievements.html&quot;&gt;&lt;img src=&quot;http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2frandomactsofcoding.blogspot.com%2f2010%2f03%2fdevelopment-achievements.html&amp;bgcolor=006699&quot; border=&quot;0&quot; alt=&quot;kick it on DotNetKicks.com&quot; /&gt;&lt;/a&gt;&lt;a rev=&quot;vote-for&quot; href=&quot;http://dotnetshoutout.com/Random-Acts-of-Coding-Development-Achievements&quot;&gt;&lt;img alt=&quot;Shout it&quot; src=&quot;http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Frandomactsofcoding.blogspot.com%2F2010%2F03%2Fdevelopment-achievements.html&quot; style=&quot;border:0px&quot;/&gt;&lt;/a&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/03/development-achievements.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-5065750127825374491</guid><pubDate>Thu, 04 Mar 2010 16:36:00 +0000</pubDate><atom:updated>2010-03-04T10:36:12.372-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Commentary</category><title>Looking Ahead a Bit</title><description>As frequent readers have noticed, my cadence for writing has dropped as of late.  Between work and the other usual excuses, finding time to blog hasn&#39;t been easily located.  However, that doesn&#39;t mean I don&#39;t have a lot of things coming down the pipe in the next month or so.  Below is some of the topics that I&#39;ll be talking about as soon as I can find time.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Using Automapper to easily implement MVVM in ASP.Net MVC&lt;/li&gt;
&lt;li&gt;Looking at db4o - an object database&lt;/li&gt;
&lt;li&gt;Using MEF with MVC&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
I don&#39;t know how many posts will be associated with each topic; however, there&#39;s a lot to write about and some interesting examples associated with such.&lt;br /&gt;
&lt;br /&gt;
Stay Tuned.</description><link>http://randomactsofcoding.blogspot.com/2010/03/looking-ahead-bit.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-7275615988469287554</guid><pubDate>Wed, 24 Feb 2010 13:45:00 +0000</pubDate><atom:updated>2010-02-24T07:47:04.462-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MEF</category><category domain="http://www.blogger.com/atom/ns#">Presentation</category><title>Presentation: Extending Your Applications With MEF</title><description>Last night I did a presentation to the Kansas City .Net User Group on the topic of using the Managed Extensibility Framework.  The demos were simple and progressive and the slides were, hopefully, informative. While I&#39;m going to be taking a lot of the feedback in order to refine/redo the presentation into something better overall, I wanted to post the demo projects and slides here so people can access them if they so desired.  &lt;br /&gt;
&lt;br /&gt;
Demo Project Listing:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Demo 1: On the Fly MEF Implementation of just Import and Export attributes&lt;/li&gt;
&lt;li&gt;Demo 2: Using MEF&#39;s attributes at the class level and using labels and declarative type mappings.&lt;/li&gt;
&lt;li&gt;Demo 3: Using the Type Catalog&lt;/li&gt;
&lt;li&gt;Demo 4: Using the Directory Catalog&lt;/li&gt;
&lt;li&gt;Demo 5: Using the Aggregate Catalog&lt;/li&gt;
&lt;li&gt;Demo 6: Using untyped Metadata&lt;/li&gt;
&lt;li&gt;Demo 7: Using Strongly Typed Metadata&lt;/li&gt;
&lt;li&gt;Demo 8: Creating a Custom Export Attribute that contains the Metadata as well.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://cid-3cb659da2d58facb.skydrive.live.com/self.aspx/Public/MEF%20Examples/MEF%20Presentation%20Slides%20v1.zip&quot;&gt;Presentation Slide Deck (v1)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://cid-3cb659da2d58facb.skydrive.live.com/self.aspx/Public/MEF%20Examples/MEF%20Presentation%20Demos%20v1.zip&quot;&gt;Presentation Demo Projects (v1)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Lastly, this talk was registered under &lt;a href=&quot;http://www.speakerrate.com&quot;&gt;SpeakerRate&lt;/a&gt; and can be reviewed at &lt;a href=&quot;http://speakerrate.com/talks/1922&quot;&gt;http://speakerrate.com/talks/1922&lt;/a&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/02/presentation-extending-your.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-8291169270695731932</guid><pubDate>Mon, 01 Feb 2010 03:20:00 +0000</pubDate><atom:updated>2010-01-31T21:26:38.794-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DotNetMigrations</category><category domain="http://www.blogger.com/atom/ns#">MEF</category><title>A Look at the New DotNetMigrations</title><description>&lt;p&gt;One aspect of .Net that a lot of people struggle with is how to manage database changes.&amp;#160; If anyone has looked beyond .Net into the realms of &lt;a href=&quot;http://rubyonrails.org/&quot; target=&quot;_blank&quot;&gt;Ruby on Rails&lt;/a&gt; or &lt;a href=&quot;http://www.djangoproject.com/&quot; target=&quot;_blank&quot;&gt;Python&#39;s Django project&lt;/a&gt;, database management is one of the first things that becomes obviously different.&amp;#160; Thankfully, there&#39;s been a number of migration utilities that have been ported or recreated in the .Net world.&amp;#160; After trying out a couple of them, I began to notice that there was a wide variety of how each attempt to accomplish this pain point.&amp;#160; Some require &lt;a href=&quot;http://www.ironruby.net/&quot; target=&quot;_blank&quot;&gt;IronRuby&lt;/a&gt; scripting, many use a custom C# DSL, and some use external build utilities like &lt;a href=&quot;http://nant.sourceforge.net&quot; target=&quot;_blank&quot;&gt;NAnt&lt;/a&gt; to fully manage the changes.&amp;#160; One that I was introduced to by a friend and began to really enjoy was &lt;a href=&quot;http://dotnetmigrations.codeplex.com/&quot; target=&quot;_blank&quot;&gt;DotNetMigrations&lt;/a&gt; - an OSS project over at &lt;a href=&quot;http://www.codeplex.com&quot; target=&quot;_blank&quot;&gt;CodePlex&lt;/a&gt;.&lt;/p&gt;&lt;h3&gt;An Overview of DotNetMigrations&lt;/h3&gt;&lt;p&gt;DotNetMigrations started as an OSS project over at CodePlex by &lt;a href=&quot;http://www.zduck.com/&quot; target=&quot;_blank&quot;&gt;Joshua Poehls&lt;/a&gt; in early 2008 when he liked what he saw in Ruby on Rails and wished there was a sql script-based version of such a utility in .Net.&amp;#160; Unlike Rails&#39; migration strategy which used a DSL written in Ruby to do all of the database object changes, DotNetMigrations was focused around native Sql scripts that would be read and executed by the migration engine.&amp;#160; As the project evolved, new commands were added and updates to the Rails platform&#39;s migration strategy were also made to DotNetMigrations.&amp;#160; Soon, it was obvious that DotNetMigrations had a lot of potential when it comes to new commands and other things.&amp;#160; I ended up joining the project in mid 2009 to make some updates and add some commands that I required for a project I was using it on.&lt;/p&gt;&lt;p&gt;After my project was finishing up, I ended up beginning to think of ways to make the application easier to maintain.&amp;#160; After some conversations with Joshua about this, we decided to go ahead with rewrite with the goals of making it easier to maintain and extend while keeping the same spirit which it was started in.&amp;#160; This past weekend, the finishing touches were placed on the rewritten code and a new release was established with some great features.&lt;/p&gt;&lt;h3&gt;Extending DotNetMigrations Thanks to MEF&lt;/h3&gt;&lt;p&gt;Any reader of this blog knows that I&#39;ve been &lt;a title=&quot;MEF Posts on RandomActsOfCoding&quot; href=&quot;http://randomactsofcoding.blogspot.com/search/label/MEF&quot; target=&quot;_blank&quot;&gt;addicted to MEF these past few months&lt;/a&gt;.&amp;#160; When I looked at the architecture of DotNetMigrations and the goals of such, the decision to use MEF was an obvious one.&amp;#160; MEF provides the ability to not only extend but also compose internal components of an application.&amp;#160; One of the things we wanted to do was allow other people to create new commands that fit their needs without requiring them to recompile the application&#39;s source.&amp;#160; MEF allowed us to do such for external commands and because of such, we also turned all internal commands to conform to the same contracts.&amp;#160; &lt;/p&gt;&lt;p&gt;In addition to the command aspect of DotNetMigration, we also changed the way messages could be logged.&amp;#160; In the older versions of the application, it acted like a standard console application with all messages being output to the console application window.&amp;#160; This works for many scenarios; however, if you needed a &amp;quot;silent&amp;quot; program for your task scheduler or wanted to log all messages to a text file, you&#39;d have to do a lot of additional work with the source code or pipe the command to the text file at the command line.&amp;#160; Through using MEF and the custom configurable type catalog, creating new logs becomes easy as well as being able to utilize one or many different logging mechanisms.&lt;/p&gt;&lt;h3&gt;What Else Is New?&lt;/h3&gt;&lt;p&gt;In addition to the core code being rewritten to leverage MEF, we also launched the &lt;a href=&quot;http://dnmcontrib.codeplex.com/&quot; target=&quot;_blank&quot;&gt;DotNetMigrations-Contrib&lt;/a&gt; project.&amp;#160; The focus of this project was to allow others to suggest and share new logs and commands they have written.&amp;#160; The components found in this project also will help allow companies who are locked into specific versions of software upgrade with new commands without having to upgrade the core app.&amp;#160; As time passes in, some elements from the Contrib project may find their way into the core application; however, things are just starting for now.&lt;/p&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;p&gt;As new features and such are added to each project, I&#39;m sure I&#39;ll be talking about them here.&amp;#160; Until then, feel free to head over to the &lt;a href=&quot;http://www.codeplex.com&quot; target=&quot;_blank&quot;&gt;CodePlex&lt;/a&gt; projects&#39; sites and check it out for yourself.&amp;#160; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://dotnetmigrations.codeplex.com/&quot; target=&quot;_blank&quot;&gt;DotNetMigrations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://dnmcontrib.codeplex.com/&quot; target=&quot;_blank&quot;&gt;DotNetMigrations-Contrib&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;var dzone_url = &#39;http://randomactsofcoding.blogspot.com/2010/01/look-at-new-dotnetmigrations.html&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_title = &#39;A Look at the New DotNetMigrations&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_blurb = &#39;A review of the latest release of DotNetMigrations, a database migration framework for .Net that utilizes MEF.&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_style = &#39;2&#39;;&lt;/script&gt;&lt;script language=&quot;javascript&quot; src=&quot;http://widgets.dzone.com/links/widgets/zoneit.js&quot;&gt;&lt;/script&gt; &lt;a rev=&quot;vote-for&quot; href=&quot;http://dotnetshoutout.com/Random-Acts-of-Coding-A-Look-at-the-New-DotNetMigrations&quot;&gt;&lt;img alt=&quot;Shout it&quot; src=&quot;http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Frandomactsofcoding.blogspot.com%2F2010%2F01%2Flook-at-new-dotnetmigrations.html&quot; style=&quot;border:0px&quot;/&gt;&lt;/a&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/01/look-at-new-dotnetmigrations.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-5939585738477034766</guid><pubDate>Wed, 27 Jan 2010 03:24:00 +0000</pubDate><atom:updated>2010-03-16T14:04:32.943-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">MEF</category><title>Making Part Declarations Easier with InheritedExports</title><description>&lt;p&gt;After playing around with MEF for a while, you begin to find more and more locations where it could be used to extend your application.&amp;#160; It works great for a large number of scenarios and provides a method for others to extend your apps in a way as simple or complex as you want to make it for them.&amp;#160; However, anyone who has sought community participation can tell you that the best way to get such is to make thing as easy as possible for a member of the community to participate.&amp;#160; If you have the greatest, extensible application in the world but require 50 steps to get a part added to the application, the user community may not be very prone to build extensions for such.&amp;#160; Alternatively, if the work required to extend the application was whittled down to only a few steps, the probability of participation rises.&amp;#160; In this blog post, we&#39;ll look at this pattern and show how using MEF&#39;s &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; attribute can be used to make part creation extremely simple for their authors.&lt;/p&gt;&lt;h3&gt;Reviewing Previous Examples:&lt;/h3&gt;&lt;p&gt;In previous examples of this series, we created parts that would be placed into a directory and imported into the app based on how the classes were decorated.&amp;#160; By explicitly decorating our parts with the &lt;font face=&quot;Courier&quot;&gt;Export&lt;/font&gt; attribute works well since it gives us the ability to say which classes to import and which not to; however, in order to use the &lt;font face=&quot;Courier&quot;&gt;Export&lt;/font&gt; attribute we also had to include a reference to the &lt;font face=&quot;Courier&quot;&gt;System.ComponentModel.Composition&lt;/font&gt; assembly &amp;amp; namespace.&amp;#160; Depending on how we setup our part contacts, we would also need to add a reference to our application as well.&amp;#160; While that&#39;s not a lot of setup, it adds up since it has to be done every time a new part has to be created.&amp;#160; If the parts were created as part of a framework or engine, then it would be in a person&#39;s best interest to create a VS template or some other form of code generation or snippets to automate as much of that ceremony as possible.&amp;#160; But what if there was a simpler way to address this from within the application we&#39;re trying to extend?&lt;/p&gt;&lt;h3&gt;Simplification through Inherited Exporting:&lt;/h3&gt;&lt;p&gt;One of the lesser-documented items contained within MEF is the &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; attribute.&amp;#160; This attribute flags all derived classes as parts that fit the contract defined by it.&amp;#160; So instead of requiring every part that implements a particular interface or base class to use the &lt;font face=&quot;Courier&quot;&gt;Export&lt;/font&gt; attribute and settings, you can just decorate the interface or base class with the &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; attribute and then every class is considered to be an &lt;font face=&quot;Courier&quot;&gt;Exported&lt;/font&gt; part by default.&amp;#160; If you are familiar with WCF, this is similar to the practice of creating an Interface for declaring your data contracts instead of directly decorating concrete classes.&amp;#160; Below is an comparison between the way that has been show thus far and using the &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; attribute.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Previous Example:&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;[Export(&lt;span class=&quot;str&quot;&gt;&amp;quot;commands&amp;quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(ICommand))]&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Command1 : ICommand&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Implementation of the Interface&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;[Export(&lt;span class=&quot;str&quot;&gt;&amp;quot;commands&amp;quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(ICommand))]&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Command2 : ICommand&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Implementation of the Interface&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;p&gt;&lt;strong&gt;Inherited Example:&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;[InheritedExport(&lt;span class=&quot;str&quot;&gt;&amp;quot;commands&amp;quot;&lt;/span&gt;,&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(ICommand))]&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;interface&lt;/span&gt; ICommand&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Interface Declaration&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Command1 : ICommand&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Implementation of the Interface&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Command2 : ICommand&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Implementation of Interface&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;p&gt;Without the requirement of marking all of the parts with the &lt;font face=&quot;Courier&quot;&gt;Export&lt;/font&gt; attribute, the developers who are creating extensible parts for your application will no longer need to reference the &lt;font face=&quot;Courier&quot;&gt;System.ComponentModel.Composition&lt;/font&gt; namespace.&amp;#160; In addition, the risk of mistyping the contract information in the &lt;font face=&quot;Courier&quot;&gt;Export&lt;/font&gt; attribute is removed.&amp;#160; By using the &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; attribute, the only requirement for authoring parts becomes just a reference to the assembly containing the decorated base class or assembly.&lt;/p&gt;&lt;h3&gt;A Useful Pattern of Inherited Exporting:&lt;/h3&gt;&lt;p&gt;While the &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; attribute provides a simplified and safer method of handling part creation, it is an All-or-Nothing mechanism.&amp;#160; While there are ways to exclude parts using different catalogs, there is no way to explicitly exclude a part like you could when we were using the &lt;font face=&quot;Courier&quot;&gt;Export&lt;/font&gt; attribute on all parts.&amp;#160; A good way around this issue is to base your part contract/type on an &lt;font face=&quot;Courier&quot;&gt;interface&lt;/font&gt; and add the &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; attribute to an &lt;font face=&quot;Courier&quot;&gt;abstract base class&lt;/font&gt; that implements said &lt;font face=&quot;Courier&quot;&gt;interface&lt;/font&gt;.&amp;#160; This provides the blanketed support and convenience of using &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; while providing authors an advanced mechanism by directly implementing the &lt;font face=&quot;Courier&quot;&gt;interface&lt;/font&gt; and adding the &lt;font face=&quot;Courier&quot;&gt;Export&lt;/font&gt; attribute manually if needed.&amp;#160; Below is an example of this pattern.&lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;interface&lt;/span&gt; ICommand&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Interface Declaration&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;[InheritedExport(&lt;span class=&quot;str&quot;&gt;&amp;quot;commands&amp;quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(ICommand))]&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; CommandBase : ICommand&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Abstract implementation of the Interface&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Command1 : CommandBase&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Implementation of the Abstract Class&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Command2 : CommandBase&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  18:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  19:  &lt;/span&gt;    &lt;span class=&quot;rem&quot;&gt;// Implementation of the Abstract Class&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  20:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;h3&gt;Summary:&lt;/h3&gt;&lt;p&gt;In this post, we looked at how to streamline and simplify our part definitions by using the &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; method instead of just the &lt;font face=&quot;Courier&quot;&gt;Export&lt;/font&gt; attribute.&amp;#160; We looked at the benefits of this simplicity and how it can help make things easier for part authors as well as identified a possible fault with using the &lt;font face=&quot;Courier&quot;&gt;InheritedExport&lt;/font&gt; attribute at the wrong level of abstraction.&amp;#160; In the corresponding example project linked below, the concepts discussed above are applied to a previous example project in order to illustrate some of the simple benefits that can be used within your application.&lt;/p&gt;&lt;h3&gt;Resources:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a title=&quot;Blog Post Example Project&quot; href=&quot;http://cid-3cb659da2d58facb.skydrive.live.com/self.aspx/Public/MEF%20Examples/MEFExample9.zip&quot; target=&quot;_blank&quot;&gt;Example #9 Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;Blog post series table of contents.&quot; href=&quot;http://randomactsofcoding.blogspot.com/2009/11/working-with-managed-extensibility.html&quot; target=&quot;_blank&quot;&gt;Series Table of Contents&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_url = &#39;http://randomactsofcoding.blogspot.com/2010/01/making-part-declarations-easier-with.html&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_title = &#39;Making Part Declarations Easier with InheritedExports&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_blurb = &#39;A look at the lesser documented feature of the Managed Extensibility Framework - the InheritedExport attribute.&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_style = &#39;2&#39;;&lt;/script&gt;&lt;script language=&quot;javascript&quot; src=&quot;http://widgets.dzone.com/links/widgets/zoneit.js&quot;&gt;&lt;/script&gt; &lt;a href=&quot;http://www.dotnetkicks.com/kick/?url=http%3a%2f%2frandomactsofcoding.blogspot.com%2f2010%2f01%2fmaking-part-declarations-easier-with.html&quot;&gt;&lt;img src=&quot;http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2frandomactsofcoding.blogspot.com%2f2010%2f01%2fmaking-part-declarations-easier-with.html&amp;bgcolor=006699&quot; border=&quot;0&quot; alt=&quot;kick it on DotNetKicks.com&quot; /&gt;&lt;/a&gt; &lt;a rev=&quot;vote-for&quot; href=&quot;http://dotnetshoutout.com/Random-Acts-of-Coding-Making-Part-Declarations-Easier-with-InheritedExports&quot;&gt;&lt;img alt=&quot;Shout it&quot; src=&quot;http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Frandomactsofcoding.blogspot.com%2F2010%2F01%2Fmaking-part-declarations-easier-with.html&quot; style=&quot;border:0px&quot;/&gt;&lt;/a&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/01/making-part-declarations-easier-with.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-1593727950428669552</guid><pubDate>Wed, 13 Jan 2010 04:24:00 +0000</pubDate><atom:updated>2010-01-12T22:31:26.438-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">MEF</category><title>A Configurable Type Catalog for MEF</title><description>Over the past month or so, I&#39;ve had&amp;nbsp; some time to focus on a few different projects.&amp;nbsp; In one of these new projects, I was using MEF in order to provide a number of extensibility points.&amp;nbsp; Everything was going well until I started to dive into a place where I wanted it to be extensible but also configurable like a traditional provider model scattered throughout the .Net framework. With MEF, there&#39;s a couple of different ways of handling this situation; however, after playing around with a few of them, I decided to extend the TypeCatalog in order to provide another layer of abstraction that allows me to harness the power of MEF with the ability of outside configuration. In this article, we&#39;ll diving into the code that provides provider-like configuration aspects to MEF as well as shine the light at 2 possible pitfalls of using something like this.&amp;nbsp; Before we do that though, let&#39;s examine what MEF has to offer out of the box in order to understand why I felt another layer was needed for my project.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Looking in the Box and at MEF-Contrib&lt;/h3&gt;So far in my MEF posts, I&#39;ve really been focused on simple solutions that utilize the AssemblyCatalog and DirectoryCatalog objects.&amp;nbsp; These specific catalogs provide a very fast and easy way of composing your various parts together. Part of their simplicity comes from how they handle the parts that it finds in the assemblies you provide it; namely, they take an All-or-Nothing approach.&amp;nbsp; If they find parts that meet the defined contract criteria, they assume that they are going to be part of some composition.&amp;nbsp; But what if you only wanted to use only a few parts located in a loaded assembly?&amp;nbsp; &lt;br /&gt;
This question was half of the problem I was trying to solve for my project.&amp;nbsp; Looking around what&#39;s been done so far with MEF, I saw that I could address this part of my problem using a TypeCatalog.&amp;nbsp; A TypeCatalog differs from other ComposablePartCatalogs in that it allows you to explicitly specify which Types you want to use as Parts.&amp;nbsp; For example, in previous posts we showed &quot;Help Text&quot; of various parts that represented different commands/arguments of a command line application.&amp;nbsp; If you didn&#39;t want Command #2, you could simply load all other commands into a collection explicitly and then pass the collection into a TypeCatalog. &lt;br /&gt;
Great, one problem solved, right?&amp;nbsp; I can now explicitly load which parts I want to import; however, the second part of my problem was that I didn&#39;t want to recompile&amp;nbsp; the code every time I wanted to change which parts were imported.&amp;nbsp; At this point, I started to look around at what other people might have already done that would allow this type of configuration.&amp;nbsp; I ended up looking at the Provider Model for MEF that was a part of the &lt;a href=&quot;http://mefcontrib.codeplex.com/&quot; target=&quot;_blank&quot; title=&quot;MEF-Contrib&quot;&gt;MEF-Contrib project out on CodePlex&lt;/a&gt;. What the Provider Model from MEF-Contrib does is move the part declarations (i.e. the Import and Export Attributes) to a custom configuration section.&amp;nbsp; This held a lot of promise; however, ran into some trouble while working with it.&amp;nbsp; After about a day of working with the MEF-Contrib provider model, I decided to try my hand at a different approach.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Adding a Layer on top of MEF&lt;/h3&gt;While I&#39;m still determined to look into the MEF-Contrib provider model deeper in the near future, I also began to feel that mixing the attributed model and a provider model in the same application felt a bit dirty or smelly. I wanted the leverage the power and simplicity MEF&#39;s attributed model but be able to push it to the level of configuration that comes with a provider model.&amp;nbsp; In order to reach this goal, I decided to add another layer of abstraction onto of the great foundation MEF provides for extensibility.&lt;br /&gt;
In order to do this, I needed 2 things:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;A Custom Configuration Section to Identify the specific Types to import &lt;/li&gt;
&lt;li&gt;A ComposablePartCatalog that will grab these parts. &lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;h3&gt;Creating the Configuration Section&lt;/h3&gt;I&#39;m not going to go into a large amount of information on how to create a custom configuration section.&amp;nbsp; There&#39;s a large amount of resources out on the Internet that can assist with such.&amp;nbsp; What I needed was a simple section that took a collection of types.&amp;nbsp; I wanted to truly keep things simple.&amp;nbsp; What came out mapped to the following:&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;1:  &amp;lt;configuration&amp;gt;&lt;/pre&gt;&lt;pre&gt;2:      &amp;lt;configSections&amp;gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;3:          &amp;lt;section&lt;/pre&gt;&lt;pre&gt;4:            name=&quot;mef.configurableTypes&quot;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;5:            type=&quot;MEFExample8.Core.Provider.ConfigurableTypeSection, MEFExample8.Core&quot; /&amp;gt;&lt;/pre&gt;&lt;pre&gt;6:      &amp;lt;/configSections&amp;gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;7:  &amp;nbsp;&lt;/pre&gt;&lt;pre&gt;8:      &amp;lt;mef.configurableTypes&amp;gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;9:          &amp;lt;parts&amp;gt;&lt;/pre&gt;&lt;pre&gt;10:              &amp;lt;part type=&quot;MEFExample8.TestCommand1, MEFExample8&quot; /&amp;gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;11:              &amp;lt;part type=&quot;MEFExample8.Commands.TestCommand3, MEFExample8.Commands&quot; /&amp;gt;&lt;/pre&gt;&lt;pre&gt;12:          &amp;lt;/parts&amp;gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;13:      &amp;lt;/mef.configurableTypes&amp;gt;&lt;/pre&gt;&lt;pre&gt;14:  &amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Creating the Catalog&lt;/h3&gt;Now that I have the section how I needed it, I had to create a catalog that will utilize it.&amp;nbsp; While I could have create a custom catalog using the ComposablePartCatalog base class, I decided to just extend the TypeCatalog that comes with MEF.&amp;nbsp; The TypeCatalog works great for such and the only thing I had to do was bring in the Types from the config file, load them into an IEnumerable&amp;lt;Type&amp;gt; collection, and then pass it to the TypeCatalog base.&amp;nbsp; Simple right?&lt;br /&gt;
As it turned out, I looked beyond my original needs and found two issues.&amp;nbsp; The first was addressing what to do if the configuration section was named differently.&amp;nbsp; The second issue was dealing with what to do if the catalog is instantiated more than once.&amp;nbsp; Luckily, a simple solution to both was to allow the developer to pass in the section name into the catalog&#39;s constructor.&amp;nbsp; This addressed the renaming concern while allowing multiple catalogs to point to different configuration sections.&lt;br /&gt;
Below is the catalog&#39;s code:&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;1:  public class ConfigurableTypeCatalog : TypeCatalog&lt;/pre&gt;&lt;pre&gt;2:  {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;3:      public ConfigurableTypeCatalog()&lt;/pre&gt;&lt;pre&gt;4:          : base(GetTypes())&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;5:      {&lt;/pre&gt;&lt;pre&gt;6:      }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;7:  &amp;nbsp;&lt;/pre&gt;&lt;pre&gt;8:      public ConfigurableTypeCatalog(string sectionName)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;9:          : base(GetTypes(sectionName))&lt;/pre&gt;&lt;pre&gt;10:      {            &lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;11:      }&lt;/pre&gt;&lt;pre&gt;12:  &amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;13:      private static IEnumerable&amp;lt;Type&amp;gt; GetTypes()&lt;/pre&gt;&lt;pre&gt;14:      {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;15:          return GetTypes(&quot;mef.configurableTypes&quot;);&lt;/pre&gt;&lt;pre&gt;16:      }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;17:  &amp;nbsp;&lt;/pre&gt;&lt;pre&gt;18:      private static IEnumerable&amp;lt;Type&amp;gt; GetTypes(string sectionName)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;19:      {&lt;/pre&gt;&lt;pre&gt;20:          var config = GetSection(sectionName);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;21:  &amp;nbsp;&lt;/pre&gt;&lt;pre&gt;22:          IList&amp;lt;Type&amp;gt; types = new List&amp;lt;Type&amp;gt;();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;23:  &amp;nbsp;&lt;/pre&gt;&lt;pre&gt;24:          foreach (ConfigurableTypeElement p in config.Parts)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;25:          {&lt;/pre&gt;&lt;pre&gt;26:              types.Add(Type.GetType(p.Type));&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;27:          }&lt;/pre&gt;&lt;pre&gt;28:  &amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;29:          return types;&lt;/pre&gt;&lt;pre&gt;30:      }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;31:  &amp;nbsp;&lt;/pre&gt;&lt;pre&gt;32:      private static ConfigurableTypeSection GetSection(string sectionName)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;33:      {&lt;/pre&gt;&lt;pre&gt;34:          var config = ConfigurationManager.GetSection(sectionName) as ConfigurableTypeSection;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;35:  &amp;nbsp;&lt;/pre&gt;&lt;pre&gt;36:          if (config == null)&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;37:          {&lt;/pre&gt;&lt;pre&gt;38:              throw new ConfigurationErrorsException(string.Format(&quot;The configuration section {0} could not be found.&quot;, sectionName));&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;39:          }&lt;/pre&gt;&lt;pre&gt;40:  &amp;nbsp;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;41:          return config;&lt;/pre&gt;&lt;pre&gt;42:      }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;43:  }&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
As I stated before, I decided to extend the TypeCatalog class. In order to extend it and meet the needs of my project, I overloaded the constructor so that I could set the default configuration section name (used in the configuration file snippet above) while allowing the second constructor to specify the section name.&amp;nbsp; Since the constructor of the TypeCatalog class takes either a single Type or a collection of Types, I turned the code that retrieves that information from the configuration section into a static value.&amp;nbsp; Since I&#39;m not overriding any aspects of the TypeCatalog other than the constructors, I needed a way to pass the information to it as such and the static methods provided.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Notes about the Catalog:&lt;/h3&gt;At this point, I have a fully functional catalog that allows me to specify which types to include into a certain piece of my application. After I played around with it a bit I found that it worked well but had a few shortcomings that may cause people to wonder what&#39;s going on.&lt;br /&gt;
The first scenario I came across was working with the catalog to reference parts in a subdirectory.&amp;nbsp; This issue doesn&#39;t exist if the types you are referencing are in the same assembly or an assembly that&#39;s in the same directory as the executing program; however, if the assembly is in a subdirectory, you&#39;ll need to probe the directory as described in my previous MEF post - &lt;a href=&quot;http://randomactsofcoding.blogspot.com/2009/12/using-mef-and-custom-configuration.html&quot; target=&quot;_blank&quot; title=&quot;Using MEF and Custom Configuration Sections&quot;&gt;Using MEF and Custom Configuration Sections&lt;/a&gt;.&lt;br /&gt;
The second scenario came with the need for Type or Part exclusions.&amp;nbsp; The code above uses the same attributed model that all out of the box catalogs use.&amp;nbsp; This means that if you created an assembly with 3 attributed parts in it and used an AssemblyCatalog or similar one, all 3 parts would be identify and consumed.&amp;nbsp; The custom catalog outlined in this post focuses on Type inclusion and not exclusions. Because of this, if the above catalog is combined in an AggregateCatalog, all of the parts that meet the contract will still be imported.&amp;nbsp; Through this fact, I highly recommend using the above catalog separately from the others.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;So What&#39;s Next?&lt;/h3&gt;As for this catalog, I need to do a bit more refining and possibly add a few more catalogs that follow a similar manner.&amp;nbsp; Ultimately, I&#39;m going to be wrapping some unit tests around it and packaging it up separately.&amp;nbsp; Beyond that, there&#39;s a lot of MEF content coming in the future so stay tuned.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Resources:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://cid-3cb659da2d58facb.skydrive.live.com/self.aspx/Public/MEF%20Examples/MEFExample8.zip&quot; target=&quot;_blank&quot; title=&quot;Example project for the post&quot;&gt;Example #8 Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://randomactsofcoding.blogspot.com/2009/11/working-with-managed-extensibility.html&quot; target=&quot;_blank&quot; title=&quot;MEF Post Series Table of Contents&quot;&gt;Series Table of Contents&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var dzone_url = &#39;http://randomactsofcoding.blogspot.com/2010/01/configurable-type-catalog-for-mef.html&#39;;
&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;
var dzone_title = &#39;A Configurable Type Catalog for MEF&#39;;
&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;
var dzone_blurb = &#39;A post that looks at what extending the TypeCatalog that comes with the Managed Extensibility Framework to provide provider-model like functionality.&#39;;
&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;
var dzone_style = &#39;2&#39;;
&lt;/script&gt;&lt;script language=&quot;javascript&quot; src=&quot;http://widgets.dzone.com/links/widgets/zoneit.js&quot;&gt;
&lt;/script&gt; &lt;a href=&quot;http://www.dotnetkicks.com/kick/?url=http%3a%2f%2frandomactsofcoding.blogspot.com%2f2010%2f01%2fconfigurable-type-catalog-for-mef.html&quot;&gt;&lt;img alt=&quot;kick it on DotNetKicks.com&quot; border=&quot;0&quot; src=&quot;http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2frandomactsofcoding.blogspot.com%2f2010%2f01%2fconfigurable-type-catalog-for-mef.html&amp;amp;bgcolor=006699&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://dotnetshoutout.com/Random-Acts-of-Coding-A-Configurable-Type-Catalog-for-MEF&quot; rev=&quot;vote-for&quot;&gt;&lt;img alt=&quot;Shout it&quot; src=&quot;http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Frandomactsofcoding.blogspot.com%2F2010%2F01%2Fconfigurable-type-catalog-for-mef.html&quot; style=&quot;border: 0px none;&quot; /&gt;&lt;/a&gt;</description><link>http://randomactsofcoding.blogspot.com/2010/01/configurable-type-catalog-for-mef.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-8059340405590286689</guid><pubDate>Wed, 06 Jan 2010 13:35:00 +0000</pubDate><atom:updated>2010-01-06T07:35:57.752-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Commentary</category><category domain="http://www.blogger.com/atom/ns#">Goals</category><title>Goals for the New Year (2010 ed.)</title><description>When I started to write down my professional goals for 2010, I ended up doing the same things as I did last year; just create a list of things to learn.&amp;nbsp; Looking back over my experiences while attempting to accomplish my goals for 2009, I began to believe that this was the wrong approach.&amp;nbsp; My initial goals were very focused on learning different technologies or hitting certain milestones in general.&amp;nbsp; By the end of 2009, I found that sure I may have hit most of my goals; however, something was lacking.&lt;br /&gt;
&lt;br /&gt;
For example, one of the items that I completely wasn&#39;t anticipating becoming so passionate about was the possibilities of MEF.&amp;nbsp; This lead to a large number of rapid fire posts in March on some pretty rudimentary tutorials on the basics of MEF.&amp;nbsp; While I was working on creating these tutorials, I constantly wished I was able to work on the latter posts (the ones that I&#39;m slowly working on currently).&amp;nbsp; It wasn&#39;t because I didn&#39;t think providing tutorial information wasn&#39;t important but being able to provide a better context was.&amp;nbsp; This was also true earlier in the year during my initial F# exploits.&amp;nbsp; Doing tutorials is good but sometimes showing the overall value before the tutorials can provide the basis as to the WHY someone can learn something instead of just the HOW to use it.&amp;nbsp; If you have ever looked into becoming a better speaker, this practice is sometimes described as &quot;showing the sex first&quot;.&amp;nbsp; Get a person interested and intrigued first and then provide them the information and tools necessary to run with what you showed.&lt;br /&gt;
&lt;br /&gt;
With this in mind, it&#39;s what my goals now resolve around.&amp;nbsp; While I&#39;ll be working hard on learning new technologies or tying down loose ends on technologies I haven&#39;t fully learned, my focus is going to be on context.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Things I&#39;m focusing on in 2010:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Getting More Involved&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
I&#39;m a firm believer that teaching is one of the greatest ways of evaluating how well you know a topic. One of the things I discovered a few years back is a passion for presenting and teaching. Combine that with a desire to get more involved in the development community as a whole and it leads to a lot of opportunities.&amp;nbsp; Right now I&#39;m staring at about 4-5 presentations just in the first half of the year to various user groups and code camps all over the midwest.&amp;nbsp; I&#39;m hoping to expand this more by the end of the year.&amp;nbsp; Sure it&#39;ll keep me busy and traveling but it&#39;s fun and I would am looking forward to meeting a lot of the community leaders at each location.&amp;nbsp; As my calendar solidifies, I&#39;ll make sure to update things here.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;More Contextual Value on Posts&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Looking over the past 2-3 years that I&#39;ve been writing in this blog, the posts that have the deepest impact are also the ones that provide the richest examples or specific focus.&amp;nbsp; Some of the basic tutorial posts have appeared to be viewed well; however, the some of the posts that took me a significantly longer amount of time to write and develop the samples for have seen the best amount of feedback.&amp;nbsp; With this in mind, I&#39;m going to focusing more on intermediate examples more than introductory posts.&amp;nbsp; The introductory elements will still remain; however, I&#39;m hoping to change the quantity of the two types of posts in order to provide more balance and value to the readers. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Tying up Loose Ends&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Last year I worked a lot on learning a number of new tools; however, some of them I only learned enough to understand where they may fit into my current situation (a.k.a. just learning what value is in it for me).&amp;nbsp; This is usually a pretty good way of learning things; however, it can limit the potential. After changing jobs at the end of 2009, being able to reevaluate what I learned last year and expand on such will allow me to adapt better to different scenarios.&amp;nbsp; This also will help me provide even better context when learning other things. An example of this is the fact that while I know the basics of writing in Silverlight, I need a little bit deeper understanding of it so that I can start applying MEF into my Silverlight applications when applicable.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Redefining a Dream&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
When I started getting serious about my development career, I wondered what I would consider to be my dream job.&amp;nbsp; This idea always shifted with every career progression on my way towards my dream job.&amp;nbsp; Recently, I landed a job that is the closest match thus far and am begin to evaluate the environments and companies I&#39;ve worked for thus far as well as my current one.&amp;nbsp; While I don&#39;t plan on leaving my current employer since I just came onboard and they are a very good company thus far, I&#39;m a person that loves striving for what&#39;s next. Perhaps what&#39;s next is not a different company but something that augments my day job like getting more involved. Perhaps is back to a more remote working environment.&amp;nbsp; Lots of ideas to consider and think about.&amp;nbsp; Ultimately though, it&#39;s the journey that drives me, not what I have currently obtains. Anything is possible as long as you keep dreaming in my opinion.</description><link>http://randomactsofcoding.blogspot.com/2010/01/goals-for-new-year-2010-ed.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-2303522097938832197</guid><pubDate>Wed, 30 Dec 2009 12:46:00 +0000</pubDate><atom:updated>2009-12-30T06:46:41.732-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Commentary</category><category domain="http://www.blogger.com/atom/ns#">TDD</category><title>Controlling Personal Projects with TDD/BDD</title><description>Last night, a friend and I were discussing our ever growing list of personal projects and tasks that we strive to find/make time to whittle away.  The items on our list ranged from reading a simple blog post, asking a mentor a question, or working on a personal, pet project.  I don&#39;t know any developer who doesn&#39;t have a similar list to be honest.&lt;br /&gt;
&lt;br /&gt;
Though the conversation, we began to talk about an issue we were both sharing about our pet projects getting drawn out.  While there are true reasons (i.e. time constraints being the most prevalent), the one that plagued us was the concept of scope creep.  As a developer, we battle with scope creep during our day jobs (usually) but to experience such at home leads to only a single person to put the blame on; ourselves.&lt;br /&gt;
&lt;br /&gt;
This really got me thinking and reflecting on my project and my own scope creep issues.  I began to realize that every time I had scope creep, it was a spot where I hadn&#39;t written unit tests first.  In many cases I focus on a test-first strategy of TDD; however, there are a few times when I get in the flow and just write the code.  This works sometimes but the times in which I can identify as scope creep all fell into these moments.  If I had stayed focus on a test-first strategy, would these moments of scope creep been prevented? Probably not; however, it would have probably allowed me to be more conscience of the decision and possibly move it to some form of feature list for another iteration.&lt;br /&gt;
&lt;br /&gt;
I only use standard NUnit-based unit tests and haven&#39;t fully tried out writing specs associated with BDD.  Using something like a full spec like BDD would have been able to control the feature list a bit better but, again, not fully prevent scope creep.  Regardless of the method, staying focused on a test-first approach does have a habit of controlling and identifying scope creep.  It&#39;s easier to finishing a single iteration and enhance/refactor than it is to always go with the flow and allow the scope to continue to grow.</description><link>http://randomactsofcoding.blogspot.com/2009/12/controlling-personal-projects-with.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7881153019980313926.post-2454096203786668386</guid><pubDate>Wed, 23 Dec 2009 03:33:00 +0000</pubDate><atom:updated>2009-12-23T07:54:18.567-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">MEF</category><title>Using MEF and Custom Configuration Sections</title><description>&lt;p&gt;Up to this point, I&#39;ve dove into some of the core fundamentals of using the Managed Extensibility Framework.&amp;#160; Starting with this post, we&#39;re going to dive into how to apply it under certain circumstances.&amp;#160; Some of the scenarios in the upcoming posts will focus on using MEF with different .Net technologies, applications that use MEF, or tricks in .Net that can assist when working with MEF.&amp;#160; In this post, we&#39;ll start with this last category of scenarios by looking at how to utilize a custom configuration section defined in an assembly used as a MEF part and not located in the same directory as the executable.&amp;#160; Using this method, it will allow even greater power to your application and freedom to the parts consumed by such.&lt;/p&gt;&lt;h3&gt;Setting the Stage&lt;/h3&gt;&lt;p&gt;For this post, we&#39;ll look at a simple code base we worked on earlier in the series which imported MEF parts from a separate assembly.&amp;#160; Let&#39;s extend the code base by defining our simple custom configuration section from within the same assembly that define our external part.&amp;#160; For simplicity sake, let&#39;s call the custom configuration section &lt;font face=&quot;courier&quot;&gt;MEFCustomConfigSection&lt;/font&gt;.&amp;#160; Below is the code for our custom configuration section:&lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; MEFCustomConfigSection : ConfigurationSection&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; MEFCustomConfigSection settings = ConfigurationManager.GetSection(&lt;span class=&quot;str&quot;&gt;&amp;quot;MEFCustomConfigSection&amp;quot;&lt;/span&gt;) &lt;span class=&quot;kwrd&quot;&gt;as&lt;/span&gt; MEFCustomConfigSection;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; MEFCustomConfigSection Settings&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;        get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; settings; }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;    [ConfigurationProperty(&lt;span class=&quot;str&quot;&gt;&amp;quot;message&amp;quot;&lt;/span&gt;, IsRequired = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;)]&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Message&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;        get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;[&lt;span class=&quot;str&quot;&gt;&amp;quot;message&amp;quot;&lt;/span&gt;].ToString(); }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  15:  &lt;/span&gt;        set { &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;[&lt;span class=&quot;str&quot;&gt;&amp;quot;message&amp;quot;&lt;/span&gt;] = &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;; }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  16:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  17:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;p&gt;This configuration section is very simple in that it only defines one property/attribute called &lt;font face=&quot;courier&quot;&gt;Message&lt;/font&gt;.&amp;#160; This property will contain a string value in which we&#39;ll be displaying on the screen when the application consumes our part.&lt;/p&gt;&lt;h3&gt;Consuming Our Section &lt;/h3&gt;&lt;p&gt;Now that our configuration section has been defining, let&#39;s go ahead and create the code to consume such.&amp;#160; In previous examples, each of our parts had a property called &lt;font face=&quot;Courier&quot;&gt;HelpText&lt;/font&gt; that is used by the consuming application to display command line help documentation for each part.&amp;#160; What we will do with this new part is using our configuration section&#39;s &lt;font face=&quot;courier&quot;&gt;Message&lt;/font&gt; property to define what the value of the &lt;font face=&quot;Courier&quot;&gt;HelpText&lt;/font&gt; property should be.&amp;#160; Thankfully, the code for this is extremely simple as shown below:&lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;[Export(&lt;span class=&quot;str&quot;&gt;&amp;quot;command&amp;quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(IHelp))]&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; CustomCommand : IHelp&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; CommandName&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;        get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&amp;quot;Custom&amp;quot;&lt;/span&gt;; }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; HelpText&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;        get { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; MEFCustomConfigSection.Settings.Message; }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;h3&gt;Setting Up the Configuration File&lt;/h3&gt;&lt;p&gt;Now that we have the custom configuration section created and code that needs it, we&#39;re now ready to update our consuming application&#39;s &lt;font face=&quot;Courier&quot;&gt;App.config&lt;/font&gt; file. &lt;/p&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;configuration&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;configSections&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;section&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;MEFCustomConfigSection&amp;quot;&lt;/span&gt; &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;                 &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;MEFExample7.Commands.MEFCustomConfigSection, MEFExample7.Commands&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;configSections&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   7:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;MEFCustomConfigSection&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Hello From a Custom Section&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   9:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;runtime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  10:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;assemblyBinding&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  11:  &lt;/span&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;probing&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;privatePath&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Plug-ins;&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  12:  &lt;/span&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;assemblyBinding&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;  13:  &lt;/span&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;runtime&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;    &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  14:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;configuration&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, &quot;Courier New&quot;, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;p&gt;Setting up the custom configuration section is the same as any other configuration section that would need to be setup.&amp;#160; We first define our section within the &lt;font face=&quot;Courier&quot;&gt;&amp;lt;configSections&amp;gt;&lt;/font&gt; node and then we&#39;re able to insert our section; however, what&#39;s that last section?&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier&quot;&gt;&amp;lt;runtime&amp;gt;&lt;/font&gt; section in the above snippet is needed to tell .Net to scan the&lt;font face=&quot;Courier&quot;&gt; Plug-ins&lt;/font&gt; subdirectory for the assembly that contains our configuration section.&amp;#160; There are two ways of doing this.&amp;#160; The example above uses the &lt;font face=&quot;Courier&quot;&gt;&amp;lt;probing&amp;gt;&lt;/font&gt; node which is great for little examples like this; however, can lead to performance issues since it will scan all assemblies in the paths that are provided.&amp;#160; Another issue with the &lt;font face=&quot;Courier&quot;&gt;&amp;lt;probing&amp;gt;&lt;/font&gt; node is that it doesn&#39;t provide a way for targeting specific, strongly named assemblies nor specific assembly versions.&amp;#160; If you need stronger control of what assemblies gets loaded, you can use the &lt;font face=&quot;Courier&quot;&gt;&amp;lt;codeBase&amp;gt;&lt;/font&gt; node instead.&lt;/p&gt;&lt;p&gt;For more information on using the &lt;font face=&quot;Courier&quot;&gt;&amp;lt;probing&amp;gt;&lt;/font&gt; and &lt;font face=&quot;Courier&quot;&gt;&amp;lt;codeBase&amp;gt;&lt;/font&gt; nodes for loading assemblies this way, feel free to check out the following links:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a title=&quot;MSDN - Specifying an Assembly&amp;#39;s Location&quot; href=&quot;http://msdn.microsoft.com/en-us/library/4191fzwb%28VS.80%29.aspx&quot; target=&quot;_blank&quot;&gt;Specifying an Assembly&#39;s Location&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;MSDN - Locating an Assembly&amp;#39;s through Codebases and Probing&quot; href=&quot;http://msdn.microsoft.com/en-us/library/15hyw9x3%28VS.80%29.aspx&quot; target=&quot;_blank&quot;&gt;Locating an Assembly&#39;s through Codebases and Probing&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;NOTE: One final item I need to mention about using &lt;font face=&quot;Courier&quot;&gt;&amp;lt;probing&amp;gt;&lt;/font&gt;, it can only look in subdirectories of the location the executable is in.&amp;#160; So if the assembly is in &lt;font face=&quot;Courier&quot;&gt;/bin&lt;/font&gt;, your path to probe for assemblies cannot be in a parent directory.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Once the configuration section is setup, and the &lt;font face=&quot;Courier&quot;&gt;Plug-ins&lt;/font&gt; directory is a child directory of the location of the executable, our new command is now displayed when the application runs.&lt;/p&gt;&lt;h3&gt;Summary&lt;/h3&gt;&lt;p&gt;In this post, we briefly looked at some things to be aware of when defining a custom configuration section from with in an assembly used as an external MEF part.&amp;#160; In future posts, we&#39;ll be looking at other scenarios on using MEF including consuming parts written in F# by a C# application as well as take a look at an open source project that will soon be releasing a new version that uses MEF.&lt;/p&gt;&lt;p&gt;Resources&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a title=&quot;Blog Post&amp;#39;s Example Project and Source Code&quot; href=&quot;http://cid-3cb659da2d58facb.skydrive.live.com/self.aspx/Public/MEF%20Examples/MEFExample7.zip&quot; target=&quot;_blank&quot;&gt;Example #7 Project&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a title=&quot;MEF Blog Post Series Table of Contents&quot; href=&quot;http://randomactsofcoding.blogspot.com/2009/11/working-with-managed-extensibility.html&quot; target=&quot;_blank&quot;&gt;Series Table of Contents&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_url = &#39;http://randomactsofcoding.blogspot.com/2009/12/using-mef-and-custom-configuration.html&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_title = &#39;Using MEF and Custom Configuration Sections&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_blurb = &#39;[description]&#39;;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;var dzone_style = &#39;2&#39;;&lt;/script&gt;&lt;script language=&quot;javascript&quot; src=&quot;http://widgets.dzone.com/links/widgets/zoneit.js&quot;&gt;&lt;/script&gt; &lt;a href=&quot;http://www.dotnetkicks.com/kick/?url=http%3a%2f%2frandomactsofcoding.blogspot.com%2f2009%2f12%2fusing-mef-and-custom-configuration.html&quot;&gt;&lt;img src=&quot;http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2frandomactsofcoding.blogspot.com%2f2009%2f12%2fusing-mef-and-custom-configuration.html&amp;bgcolor=006699&quot; border=&quot;0&quot; alt=&quot;kick it on DotNetKicks.com&quot; /&gt;&lt;/a&gt;&lt;a rev=&quot;vote-for&quot; href=&quot;http://dotnetshoutout.com/Random-Acts-of-Coding-Using-MEF-and-Custom-Configuration-Sections&quot;&gt;&lt;img alt=&quot;Shout it&quot; src=&quot;http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Frandomactsofcoding.blogspot.com%2F2009%2F12%2Fusing-mef-and-custom-configuration.html&quot; style=&quot;border:0px&quot;/&gt;&lt;/a&gt;</description><link>http://randomactsofcoding.blogspot.com/2009/12/using-mef-and-custom-configuration.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>1</thr:total></item></channel></rss>