<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Infovark Underground</title>
	
	<link>http://underground.infovark.com</link>
	<description>The Infovark technology blog</description>
	<lastBuildDate>Tue, 06 Jul 2010 13:42:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/InfovarkUnderground" /><feedburner:info uri="infovarkunderground" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Reflecting on reflection in .NET</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/l60ni84xAkY/</link>
		<comments>http://underground.infovark.com/2010/07/06/reflecting-on-reflection-in-net/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 13:40:28 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[factory]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[reflection]]></category>
		<category><![CDATA[service locator]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=678</guid>
		<description><![CDATA[System.Reflection is a big hammer in the .NET programmer's toolbox. And I have the sore thumbs to prove it!


Related posts:<ol><li><a href='http://underground.infovark.com/2010/04/20/avoiding-the-new/' rel='bookmark' title='Permanent Link: Avoiding the &#8220;new&#8221;'>Avoiding the &#8220;new&#8221;</a></li>
<li><a href='http://underground.infovark.com/2010/06/18/the-service-locator-pattern-is-the-new-global-variable/' rel='bookmark' title='Permanent Link: The Service Locator pattern is the new global variable'>The Service Locator pattern is the new global variable</a></li>
<li><a href='http://underground.infovark.com/2008/08/13/creating-dummy-targets-for-configuration-objects/' rel='bookmark' title='Permanent Link: Creating Dummy Targets for Configuration Objects'>Creating Dummy Targets for Configuration Objects</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I cringe whenever I spot code that uses System.Reflection. It&#8217;s a powerful weapon in our arsenal of .NET programming techniques &#8212; and a dangerous one.</p>
<p>In two previous posts, I talked about <a href="http://underground.infovark.com/2010/04/20/avoiding-the-new/">the misuse of dependency injection</a> and the <a href="http://underground.infovark.com/2010/06/18/the-service-locator-pattern-is-the-new-global-variable/">problems with the service locator pattern</a>. I should include <a href="http://en.wikipedia.org/wiki/Factory_pattern">factories</a> among the list of dangerous patterns too.</p>
<p>These patterns get overused in many .NET frameworks and toolkits. Some of that stems from a desire to avoid complex configuration. Some of it comes from the natural envy programmers in stuffy statically typed languages feel regarding their freewheeling counterparts using dynamically typed languages. </p>
<p>(Wikipedia has a good article exploring the differences in <a href="http://en.wikipedia.org/wiki/Type_system#Type_checking">type checking in computer language type systems</a>, if you&#8217;re curious about the different paradigms. But I digress.)</p>
<h4>On reflection</h4>
<p>System.Reflection two main uses, as Marc Gravell points out in his <a href="http://stackoverflow.com/questions/1036928/what-problems-does-reflection-solve/1036990#1036990">answer regarding what problems Reflection solves on StackOverflow</a>:</p>
<ol>
<li>Investigating type information</li>
<li>Metaprogramming</li>
</ol>
<p>These two capabilities allow you to shoehorn dynamic or late-binding features into C# applications. In other words, it&#8217;s a <em>clever hack</em>.</p>
<p>Want to enable Ruby-style <a href="http://en.wikipedia.org/wiki/Convention_over_configuration">convention over configuration</a> in your C# framework? Use reflection! Want to reach into <code>private</code> or <code>internal</code> methods for unit testing? Use reflection! Want to add some duck typing goodness to your statically typed language? Use reflection!</p>
<h4>But on further reflection</h4>
<p>The System.Reflection API has some <strong>big</strong> drawbacks. The <a href="http://stackoverflow.com/questions/25458/how-costly-is-reflection-really">performance penalty incurred by reflection</a> is well known. Less well known is that the Reflection API is really difficult to use, especially when inspecting and creating constructor method parameters. So most framework developers skip the hard bits.</p>
<p>This means that most of these frameworks will <em>insist</em> on your using constructors without parameters in your classes. (Sometimes people call parameter-less constructors &#8220;default constructors&#8221; though it isn&#8217;t the same thing.) </p>
<p>But if you can&#8217;t use parameters in the constructors of your objects, <em>you&#8217;re doing object-oriented programming with one hand tied behind your back</em>.</p>
<p>For example, it&#8217;s difficult to achieve object immutability without using a constructor. You&#8217;ll also have a hard time enforcing business rules without constructors. And if you&#8217;re a fan of dependency injection, you&#8217;ll have to implement it via <code>Init()</code> methods or property setters, both of which can cause significant headaches.</p>
<p>So if you work with a framework or API that makes heavy use of reflection, and thus restricts the sort of constructors you use, prepare yourself for significant pain. </p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2010/04/20/avoiding-the-new/' rel='bookmark' title='Permanent Link: Avoiding the &#8220;new&#8221;'>Avoiding the &#8220;new&#8221;</a></li>
<li><a href='http://underground.infovark.com/2010/06/18/the-service-locator-pattern-is-the-new-global-variable/' rel='bookmark' title='Permanent Link: The Service Locator pattern is the new global variable'>The Service Locator pattern is the new global variable</a></li>
<li><a href='http://underground.infovark.com/2008/08/13/creating-dummy-targets-for-configuration-objects/' rel='bookmark' title='Permanent Link: Creating Dummy Targets for Configuration Objects'>Creating Dummy Targets for Configuration Objects</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/l60ni84xAkY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2010/07/06/reflecting-on-reflection-in-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2010/07/06/reflecting-on-reflection-in-net/</feedburner:origLink></item>
		<item>
		<title>The Service Locator pattern is the new global variable</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/PeZyVa5Faz0/</link>
		<comments>http://underground.infovark.com/2010/06/18/the-service-locator-pattern-is-the-new-global-variable/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 15:30:42 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[inversion of control]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[service locator]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=672</guid>
		<description><![CDATA[Is the Service Locator pattern just a sneaky way of creating global variables?


Related posts:<ol><li><a href='http://underground.infovark.com/2010/07/06/reflecting-on-reflection-in-net/' rel='bookmark' title='Permanent Link: Reflecting on reflection in .NET'>Reflecting on reflection in .NET</a></li>
<li><a href='http://underground.infovark.com/2010/04/20/avoiding-the-new/' rel='bookmark' title='Permanent Link: Avoiding the &#8220;new&#8221;'>Avoiding the &#8220;new&#8221;</a></li>
<li><a href='http://underground.infovark.com/2008/11/19/the-curse-of-the-singleton/' rel='bookmark' title='Permanent Link: The Curse of the Singleton'>The Curse of the Singleton</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Mark Seeman, author of an upcoming book about dependency injection, writes that <a href="http://blog.ploeh.dk/2010/02/03/ServiceLocatorIsAnAntiPattern.aspx">Service Locator is an anti-pattern</a>. He shows several code examples illustrating the difficulty of configuring and troubleshooting various implementations of the Service Locator pattern. His observations tally with my thoughts about the <a href="http://underground.infovark.com/2010/04/20/avoiding-the-new/">awkwardness of service locator implementations</a>.</p>
<p>As I was wrestling with yet another third-party software component that made heavy use of an inversion-of-control (IoC) container, I realized that service locators are the new global variable. </p>
<p>Global variables are a <a href="http://en.wikipedia.org/wiki/Code_smell">code smell</a> and should be used sparingly. </p>
<p>This means that you should use a service locator only as a <em>last resort</em>, not as the default way of wiring bits of your application together. </p>
<p>And if you&#8217;re using an IoC container, make sure that you are using it to inject dependencies through your object constructors, rather than calling its static   <code>Resolve<T>()</code> methods from within your classes.</p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2010/07/06/reflecting-on-reflection-in-net/' rel='bookmark' title='Permanent Link: Reflecting on reflection in .NET'>Reflecting on reflection in .NET</a></li>
<li><a href='http://underground.infovark.com/2010/04/20/avoiding-the-new/' rel='bookmark' title='Permanent Link: Avoiding the &#8220;new&#8221;'>Avoiding the &#8220;new&#8221;</a></li>
<li><a href='http://underground.infovark.com/2008/11/19/the-curse-of-the-singleton/' rel='bookmark' title='Permanent Link: The Curse of the Singleton'>The Curse of the Singleton</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/PeZyVa5Faz0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2010/06/18/the-service-locator-pattern-is-the-new-global-variable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2010/06/18/the-service-locator-pattern-is-the-new-global-variable/</feedburner:origLink></item>
		<item>
		<title>Review: Domain-Driven Design</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/tAkRuyyKP64/</link>
		<comments>http://underground.infovark.com/2010/05/25/review-domain-driven-design/#comments</comments>
		<pubDate>Tue, 25 May 2010 18:19:31 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ddd]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=522</guid>
		<description><![CDATA[Our review of Domain-Driven Design, an essential book for learning about modern software architecture and OO design techniques for large-scale applications.


Related posts:<ol><li><a href='http://underground.infovark.com/2009/05/14/validation-in-domain-driven-design/' rel='bookmark' title='Permanent Link: Validation in Domain Driven Design'>Validation in Domain Driven Design</a></li>
<li><a href='http://underground.infovark.com/2009/07/23/domain-models-in-high-performance-systems/' rel='bookmark' title='Permanent Link: Domain Models in High Performance Systems'>Domain Models in High Performance Systems</a></li>
<li><a href='http://underground.infovark.com/2009/05/11/review-framework-design-guidelines/' rel='bookmark' title='Permanent Link: Review: Framework Design Guidelines'>Review: Framework Design Guidelines</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 150px"><a href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215%3FSubscriptionId%3DAKIAIU3RPTD7NQ47YK4A%26tag%3Dinfovark-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0321125215"><img src="http://ecx.images-amazon.com/images/I/31ywgz51v-L._SL160_.jpg" alt="Domain-Driven Design by Eric Evans" /></a><p class="wp-caption-text">Domain-Driven Design by Eric Evans</p></div>
<p>I read Eric Evans&#8217; <a href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215%3FSubscriptionId%3DAKIAIU3RPTD7NQ47YK4A%26tag%3Dinfovark-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0321125215">Domain-Driven Design: Tackling Complexity in the Heart of Software</a> nearly six months ago, but I wanted to take some time to mull over my response to it before posting a review. </p>
<p>Reading Domain-Driven Design can be a challenge. It&#8217;s taken me a while to sort through all the concepts in my head. It&#8217;s also taken me some time to chase down the references and articles related to the book. Eric Evans makes frequent references to design patterns and often cites other books in the software design canon. If you&#8217;re not familiar with these, you&#8217;ll find the book slow going. It&#8217;s definitely worth the effort, however, especially if you work with large codebases.</p>
<p>The key is <em>large</em> codebases. For simple software applications, a straightforward procedural approach to code works just fine. At larger scales, Object Oriented approaches to code work quite well. But neither procedural code nor OO principles give much guidance about large-scale software structures. </p>
<p>After your application grows beyond a dozen classes or so, you need to start thinking about the overall organization of your code. And once you start work on an application with different logical layers or physical tiers, or one that integrates with other software applications, you ought to give Domain-Driven Design a thorough read.</p>
<h4>DDD defined</h4>
<p>Software applications are tools that help people solve problems. The scope of the problem is called the problem domain, or simply the <em>domain</em>. The process of setting up your software to tackle the problem is called domain modeling. The <a href="http://en.wikipedia.org/wiki/Domain_model">domain model</a> consists of the core concepts that help users of the software get the job done or the problem solved.</p>
<p>Domain-Driven Design recognizes that software applications have essential features needed to solve problems in the domain as well as supporting infrastructure. It places the core domain at the center of the design process and lets everything flow outward from that. It&#8217;s an approach sometimes called <a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/">onion architecture</a>, in contrast to the traditional &#8220;layer-cake&#8221; architecture diagrams you often see. </p>
<p>We write software to solve problems, so it makes sense that our software should model those problems as accurately as possible. It sounds so simple!</p>
<p>Sadly, in practice, it&#8217;s really hard to get right. Computers force us programmers to think about all sorts of things that have nothing at all to do with the problem we&#8217;re trying to solve:</p>
<ul>
<li>Resource management</li>
<li>Data access and persistence</li>
<li>Responding to user input</li>
<li>Maintaining state</li>
<li>Etc. etc. etc.</li>
</ul>
<p>These things can easily overshadow the problem we&#8217;re trying to solve. For many applications, the amount of infrastructure code you&#8217;ll write will far exceed the amount of domain logic required to solve the problem. And if you&#8217;re not careful, this infrastructure code can spread throughout your application, making it very hard to identify the core concerns of your system.</p>
<p>Eric Evans&#8217; book describes how to see the forest for the trees in large-scale applications.</p>
<h4>Three key DDD concepts</h4>
<p>One of the things Eric Evans said <a href="http://domaindrivendesign.org/library/evans_2009_1">after he wrote the book</a> was that he wished he&#8217;d put it in a different order. I agree! Here are the three most important concepts discussed in the book, from back to front.</p>
<p><strong>Bounded Contexts</strong> are a way to separate concerns within a software application. While the core of your application might deal with video editing or insurance claims processing, you will have other parts of your application that deal with corollary concerns. </p>
<p>If your system interacts with another software application or uses a web service, you obviously have a different context. These third-party components likely have different ways to model the domain, and you&#8217;ll need to translate these to your model.</p>
<p>But sometimes it&#8217;s not clear when you&#8217;ve moved from one problem domain to another. For example, within an employee timekeeping application you might have two subsystems that consider timesheets from a cost accounting perspective and a billing perspective. Though they might look at the same underlying data, the logic of how they work is different.</p>
<p>It&#8217;s important to explicitly recognize these boundaries. These edges will help determine the structure of your application.</p>
<p><strong>Domain Modeling</strong> helps you determine the essential features of your system. Your code should be the literal embodiment of these features. If it&#8217;s a paint application, we&#8217;d expect to see concepts like Canvas and Brush and Color. If it&#8217;s a airline scheduling application, we&#8217;d expect concepts like Seat and Booking and Destination.</p>
<p>Software is an abstract thing. We humans have a difficult time thinking about abstract concepts. The more concrete you can make your core domain concerns, the easier it is for you to reason about. </p>
<p><strong>Ubiquitous Language</strong> is the idea that your software development team should be using, as much as possible, the language of your customer. They need to understand the domain as completely as the client does &#8212; otherwise they&#8217;ll have a hard time designing software to solve the problem! </p>
<p>This is essentially another argument in favor of using real, concrete concepts from the problem domain in your application model. When the junior developer says, &#8220;I get exceptions when I assign this SpecialNeedsPassenger to an ExitRowSeat&#8221;, the airline executive will have some inkling what is going on. And when the customer says to the lead developer, &#8220;Oh no, we always show accumulated vacation within the current pay period&#8221; the developer will have some idea of what needs to change in the code. </p>
<h4>Specific techniques</h4>
<p>Much of the book is an exploration of how these three principles can be used to design (or refactor) a software application so that it makes more sense. Eric Evans discusses several diagramming techniques that can be used to illustrate relationships and boundaries in the domain model. He also highlights several <a href="http://en.wikipedia.org/wiki/Design_pattern">design patterns</a> that are helpful as well.</p>
<p>You can get good advice on applying specific techniques from reading blogs and looking at programming Q&#038;A sites like StackOverflow. But it&#8217;s worthwhile to explore Eric Evans&#8217; take on these and to get a solid grip on the terminology used by the DDD community. </p>
<p>If you&#8217;re a C# developer in particular, it&#8217;s easy to get confused by DDD terms like &#8220;Value Object&#8221; and &#8220;Entity&#8221; which are also used within the Microsoft .NET Framework. They have special meaning to folks in the DDD crowd. </p>
<h4>Conclusion</h4>
<p>This is the single most important book I&#8217;ve read on large-scale software construction. But it&#8217;s a challenging read because you need to know quite a bit about design patterns and have had some experience working on large scale projects. </p>
<p>The book also suffers a bit from the way it&#8217;s organized. As Eric Evans mentions in the introduction, the most important parts of the book are Parts I and IV. It&#8217;s easy to get bogged down in all the detail in the middle.</p>
<p>But those issues shouldn&#8217;t stop you from reading the book or becoming familiar with the concepts of Domain-Driven Design. It&#8217;s quickly become an essential part of the software design canon. We keep it on our <a href="http://astore.amazon.com/infovark-20?node=1">Infovark bookshelf</a> among the other key technical books..</p>
<p>Software architects and software team leads will get the most benefit from the book, but if you&#8217;re a developer on a large enterprise software project or commercial product, you&#8217;ll find the Domain-Driven approach to software construction very useful in your work.</p>
<p>If you want to learn more, check out the <a href="http://en.wikipedia.org/wiki/Domain-driven_design">Domain-Driven Design article on Wikipedia</a> and the <a href="http://domaindrivendesign.org/">Domain-Driven Design Community</a>. You can also listen to this <a href="http://www.infoq.com/interviews/domain-driven-design-eric-evans">short interview about Domain-Driven Design with Eric Evans on InfoQ</a>.</p>
<p>But the best way to get started is to read the book itself.</p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2009/05/14/validation-in-domain-driven-design/' rel='bookmark' title='Permanent Link: Validation in Domain Driven Design'>Validation in Domain Driven Design</a></li>
<li><a href='http://underground.infovark.com/2009/07/23/domain-models-in-high-performance-systems/' rel='bookmark' title='Permanent Link: Domain Models in High Performance Systems'>Domain Models in High Performance Systems</a></li>
<li><a href='http://underground.infovark.com/2009/05/11/review-framework-design-guidelines/' rel='bookmark' title='Permanent Link: Review: Framework Design Guidelines'>Review: Framework Design Guidelines</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/tAkRuyyKP64" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2010/05/25/review-domain-driven-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2010/05/25/review-domain-driven-design/</feedburner:origLink></item>
		<item>
		<title>Avoiding the “new”</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/wFcmi6aEAaw/</link>
		<comments>http://underground.infovark.com/2010/04/20/avoiding-the-new/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 15:34:02 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[inversion of control]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=638</guid>
		<description><![CDATA[Dependency Injection is an important principle of software design, but it can be overused. My biggest concern with overusing inversion-of-control (IoC) containers is that it makes learning a framework ten times harder than it needs to be. 


Related posts:<ol><li><a href='http://underground.infovark.com/2010/07/06/reflecting-on-reflection-in-net/' rel='bookmark' title='Permanent Link: Reflecting on reflection in .NET'>Reflecting on reflection in .NET</a></li>
<li><a href='http://underground.infovark.com/2010/06/18/the-service-locator-pattern-is-the-new-global-variable/' rel='bookmark' title='Permanent Link: The Service Locator pattern is the new global variable'>The Service Locator pattern is the new global variable</a></li>
<li><a href='http://underground.infovark.com/2008/10/05/one-way-serialization/' rel='bookmark' title='Permanent Link: One-Way Serialization'>One-Way Serialization</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In January, Robert Martin posted an article about <a href="http://blog.objectmentor.com/articles/2010/01/17/dependency-injection-inversion">the overuse of dependency injection</a> in many open source frameworks. At the time, I had only an academic interest in the subject. (And Uncle Bob&#8217;s rants are always a fun read.)</p>
<p>But that was <em>before</em> I started taking a look at several open source frameworks for WPF. Now I&#8217;m feeling ranty too!</p>
<p>Dependency Injection is an important principle of software design, but it can be abused. My biggest concern with overusing inversion-of-control (IoC) containers is that it makes learning a framework ten times harder than it needs to be. </p>
<p>First, you can&#8217;t tell precisely when an object gets created. Sure, it&#8217;s nice that your framework provides control over the lifetime of objects, but this should be an optional feature for advanced scenarios. Not every solution requires lazy loading. Sometimes a simple &#8220;new&#8221; will do.</p>
<p>Second, by placing all the wiring and object discovery in the container or service locator, you hide important information about how the framework components fit together. Yes, the global object factory knows what classes go with what types, but you don&#8217;t. That information is hidden among all the framework plumbing.</p>
<p>For similar reasons, Microsoft cautions against using factory methods in place of constructors in its <a href="http://www.amazon.com/Framework-Design-Guidelines-Conventions-Libraries/dp/0321545613%3FSubscriptionId%3DAKIAIU3RPTD7NQ47YK4A%26tag%3Dinfovark-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0321545613">Framework Design Guidelines</a>:</p>
<blockquote><p>Prefer constructors to factories, because they are generally more usable, consistent, and convenient than specialized construction mechanisms.</p></blockquote>
<p>I think that goes <strong>double</strong> for dependency injection and IoC containers. Eliminating constructors makes for less readable code. I can&#8217;t tell what classes other classes depend on to do their jobs. </p>
<h4>My errors should get thrown from my code</h4>
<p>Sure, IoC containers are great when everything gets wired together automagically. But when an error occurs, I want it to be thrown from my code, as close to the source of the error as possible. (Like Jeff Atwood, I assume it&#8217;s <a href="http://www.codinghorror.com/blog/archives/001079.html">always my fault</a>.) </p>
<p>Instead, frameworks that overuse dependency injection throw most of these setup, configuration, and instantiation from its internal IoC container, usually with some horribly generic error message. </p>
<p>Then it&#8217;s up to me to find which dependency failed to resolve, which constructor failed to bind, or which concrete implementation didn&#8217;t get registered. And in order to do that, I have to go spelunking in the framework code &#8212; which I don&#8217;t know well &#8212; rather than the code I was trying to write, which I know quite well.</p>
<p>Frameworks that rely on dependency injection and IoC containers practically <em>require</em> you to have the framework source available and for you to become an expert in its mysterious inner workings. If I need to step through the framework code or use reflector on it, the framework has failed me. </p>
<p>This is exactly what Uncle Bob was decrying in his article. I don&#8217;t <em>want</em> to become an expert in the XYZ framework for ABC. I just want to get my stuff done. </p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2010/07/06/reflecting-on-reflection-in-net/' rel='bookmark' title='Permanent Link: Reflecting on reflection in .NET'>Reflecting on reflection in .NET</a></li>
<li><a href='http://underground.infovark.com/2010/06/18/the-service-locator-pattern-is-the-new-global-variable/' rel='bookmark' title='Permanent Link: The Service Locator pattern is the new global variable'>The Service Locator pattern is the new global variable</a></li>
<li><a href='http://underground.infovark.com/2008/10/05/one-way-serialization/' rel='bookmark' title='Permanent Link: One-Way Serialization'>One-Way Serialization</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/wFcmi6aEAaw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2010/04/20/avoiding-the-new/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2010/04/20/avoiding-the-new/</feedburner:origLink></item>
		<item>
		<title>Check out proposed enhancements to .NET core classes</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/D6uowhvIbcU/</link>
		<comments>http://underground.infovark.com/2010/03/30/check-out-proposed-enhancements-to-net-core-classes/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 00:37:43 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=632</guid>
		<description><![CDATA[The Base Class Library (BCL) team launched a CodePlex site to preview extensions to core .NET classes and gather community feedback.


Related posts:<ol><li><a href='http://underground.infovark.com/2008/07/21/256-character-filenames-should-be-enough-for-anybody/' rel='bookmark' title='Permanent Link: 256 Character Filenames Should be Enough for Anybody'>256 Character Filenames Should be Enough for Anybody</a></li>
<li><a href='http://underground.infovark.com/2008/08/13/creating-dummy-targets-for-configuration-objects/' rel='bookmark' title='Permanent Link: Creating Dummy Targets for Configuration Objects'>Creating Dummy Targets for Configuration Objects</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Almost two years ago, I wrote a post expressing <a href="http://http://underground.infovark.com/2008/07/21/256-character-filenames-should-be-enough-for-anybody/">my frustration with the way that .NET handles long filenames</a>. Yesterday, the Base Class Library (BCL) team at Microsoft <a href="http://blogs.msdn.com/bclteam/archive/2010/03/30/bcl-codeplex-site-launch.aspx">announced</a> that they have launched a <a href="http://bcl.codeplex.com/">BCL CodePlex site</a> to gather feedback on proposed enhancements and extensions to core .NET components.</p>
<p>One of the first four features on preview is a new <a href="http://bcl.codeplex.com/wikipage?title=Long%20Path">Long Path</a> wrapper class, which will hopefully make some of the awkward hacks we&#8217;ve used in the past obsolete. Hooray!</p>
<p>The code is available for download, and they have documentation and samples as well. </p>
<p>I plan on giving the new Long Path class a <em>thorough</em> test drive.</p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2008/07/21/256-character-filenames-should-be-enough-for-anybody/' rel='bookmark' title='Permanent Link: 256 Character Filenames Should be Enough for Anybody'>256 Character Filenames Should be Enough for Anybody</a></li>
<li><a href='http://underground.infovark.com/2008/08/13/creating-dummy-targets-for-configuration-objects/' rel='bookmark' title='Permanent Link: Creating Dummy Targets for Configuration Objects'>Creating Dummy Targets for Configuration Objects</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/D6uowhvIbcU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2010/03/30/check-out-proposed-enhancements-to-net-core-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2010/03/30/check-out-proposed-enhancements-to-net-core-classes/</feedburner:origLink></item>
		<item>
		<title>Review: Code</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/lcQLuHT2Bj4/</link>
		<comments>http://underground.infovark.com/2010/03/09/review-code/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 01:35:11 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[New]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[electrical engineering]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=563</guid>
		<description><![CDATA[Code: The Hidden Language of Computer Hardware and Software by Charles Petzold is the Computer Science 101 course I'd wish I'd had in college.


Related posts:<ol><li><a href='http://underground.infovark.com/2008/11/07/review-working-effectively-with-legacy-code/' rel='bookmark' title='Permanent Link: Review: Working Effectively with Legacy Code'>Review: Working Effectively with Legacy Code</a></li>
<li><a href='http://underground.infovark.com/2009/05/11/review-framework-design-guidelines/' rel='bookmark' title='Permanent Link: Review: Framework Design Guidelines'>Review: Framework Design Guidelines</a></li>
<li><a href='http://underground.infovark.com/2008/11/05/review-the-pragmatic-programmer/' rel='bookmark' title='Permanent Link: Review: The Pragmatic Programmer'>Review: The Pragmatic Programmer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s nice to go back to your roots. And sometimes, it&#8217;s nice to go back to the roots you never had.</p>
<p>As a computer science dropout, I&#8217;d never gotten the fundamentals presented to me in a coherent fashion. I&#8217;d picked up many of the connections between mathematics, logic, and electrical engineering from reading online, but it&#8217;s no substitute for having the progress of computer science laid out in a systematic way. <a href="http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319%3FSubscriptionId%3DAKIAIU3RPTD7NQ47YK4A%26tag%3Dinfovark-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0735611319">Code: The Hidden Language of Computer Hardware and Software</a> by Charles Petzold is the Computer Science 101 course I&#8217;d wish I&#8217;d had in college.</p>
<div class="wp-caption alignleft" style="width: 150px"><a href="http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319%3FSubscriptionId%3DAKIAIU3RPTD7NQ47YK4A%26tag%3Dinfovark-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0735611319"><img src="http://ecx.images-amazon.com/images/I/31VTerGLfML._SL160_.jpg" alt="" /></a><p class="wp-caption-text">Code: The Hidden Language of Computer Hardware and Software</p></div>
<p>Code is a great trip through the fundamentals of computing. Starting from first principles the author takes you through the basic computer theory to the point where you could create your own computer. It&#8217;s a journey that begins with a simple light switch and ends with advent of the Internet.</p>
<p>Morse Code, combinatorial theory, the telegraph, logic circuits &#8212; are all parts of the story of the computer. It&#8217;s a story told without analogies, but in a straightforward building-block fashion. It describes the insights and intuitive leaps that lie behind the most important tool of our age. </p>
<p>At times, it can seem like computers and high-tech gadgets are magic. What reading a book like Code reminds us is that there&#8217;s no wizardry involved, just careful engineering. </p>
<h4>A few things I learned</h4>
<p>We were close to <a href="http://en.wikipedia.org/wiki/Steampunk">steampunk</a> era computing. All the insights required to make simple calculators and computers were present in the late 19th century. Most of the equipment had been invented for the telegraph. But it took several decades more before the pieces came together, in a 1938 master&#8217;s thesis written by <a href="http://en.wikipedia.org/wiki/Claude_Shannon">Claude Shannon</a> while at MIT. (Shannon also coined the name used for the basic unit of digital information, the <em>binary digit</em>, or bit.)</p>
<p>The idea of separating code from data &#8212; something that every programmer gets beaten into them at the beginning &#8212; goes all the way back to the origin of computing. Even though it&#8217;s all binary numbers and logic gates at the hardware level, some of those numbers represent instructions and some represent data. Many of today&#8217;s higher-level languages are so far removed from the basic circuitry that you can (sometimes) treat them as one and the same.</p>
<p>It turns out the longstanding distinction between positive and negative numbers in most programming languages derives from electrical engineering. The circuitry needed to subtract two numbers can be greatly simplified if you accept a few constraints on the size of the number and apply some tricks for how they&#8217;re encoded. I&#8217;d assumed that the reason had to do with storage space alone, but it simplifies the electrical circuitry required as well.</p>
<p>I had no idea that <a href="http://en.wikipedia.org/wiki/Assembly_language">assembly language</a> was essentially machine language with human annotations and symbols. I thought that they were fundamentally different, somehow. </p>
<p>And speaking of assembly language, I now have an vague idea of what the disassembly code Visual Studio shows me during debugging means. By the time you&#8217;re finished with Code, you&#8217;ll have a basic understanding of it as well, and for how tedious it was to program. I&#8217;m glad to be working with today&#8217;s much more expressive programming languages.</p>
<h4>Parting thoughts</h4>
<p>Code was a great read, and ought to sit on every professional programmer&#8217;s bookshelf. Part Wired, part Make, part junior high science class, it&#8217;ll teach you the inner workings of the complicated and ubiquitous devices that run everything these days.</p>
<p>My only criticism of the book was that it wrapped up too quickly. The graphical user interface gets only a chapter, and events since the rise of the Internet barely half of one. I&#8217;d like to see another volume (or two!) covering in depth everything that&#8217;s happened since the Apple Macintosh. </p>
<p>But that&#8217;s really more of a <em>compliment</em> than a criticism. </p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2008/11/07/review-working-effectively-with-legacy-code/' rel='bookmark' title='Permanent Link: Review: Working Effectively with Legacy Code'>Review: Working Effectively with Legacy Code</a></li>
<li><a href='http://underground.infovark.com/2009/05/11/review-framework-design-guidelines/' rel='bookmark' title='Permanent Link: Review: Framework Design Guidelines'>Review: Framework Design Guidelines</a></li>
<li><a href='http://underground.infovark.com/2008/11/05/review-the-pragmatic-programmer/' rel='bookmark' title='Permanent Link: Review: The Pragmatic Programmer'>Review: The Pragmatic Programmer</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/lcQLuHT2Bj4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2010/03/09/review-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2010/03/09/review-code/</feedburner:origLink></item>
		<item>
		<title>Support the JQuery Project</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/kzLO-vgsJik/</link>
		<comments>http://underground.infovark.com/2010/01/15/support-the-jquery-project/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 15:18:03 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=592</guid>
		<description><![CDATA[The JQuery Project is celebrating the release of JQuery 1.4 with 14 Days of JQuery.


Related posts:<ol><li><a href='http://underground.infovark.com/2009/01/14/jquery-turns-3/' rel='bookmark' title='Permanent Link: JQuery Turns 3'>JQuery Turns 3</a></li>
<li><a href='http://underground.infovark.com/2009/12/18/introducing-the-sparkserver-project/' rel='bookmark' title='Permanent Link: Introducing the SparkServer Project'>Introducing the SparkServer Project</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div id="attachment_596" class="wp-caption alignleft" style="width: 252px"><a href="http://underground.infovark.com/wp-content/uploads/2010/01/logo_jquery.png"><img src="http://underground.infovark.com/wp-content/uploads/2010/01/logo_jquery.png" alt="JQuery logo" title="logo_jquery" width="242" height="76" class="size-full wp-image-596" /></a><p class="wp-caption-text">Adopting JQuery was one of the smartest technology decisions we made.</p></div>
<p>Gordon and I faced a lot of technology choices when we began work on Infovark. One of the best decisions we made was using the <a href="http://jquery.org">JQuery</a> JavaScript framework. </p>
<p>Today marks the <a href="http://jquery14.com/day-01/jquery-14">official release of JQuery 1.4</a>. This new version brings several performance improvements, greater support for JSON, Ajax, and HTML 5, and many other improvements. </p>
<p>What are you waiting for? Go get it.</p>
<h4>Share the love</h4>
<p>All this programming goodness comes free, but the JQuery Project is asking for contributions to support the effort.</p>
<p>Since the Infovark coffers are a bit thin at the moment, I made a personal donation to the JQuery Project. To celebrate the release of JQuery 1.4, for the next 14 days any donation over $20 will receive a free JavaScript ebook. The details are on the <a href="http://jquery14.com/donate">donate</a> page.</p>
<p>I gave the JQuery Project $30. Considering the amount of time it&#8217;s saved me, it was a small amount, but I figure every bit helps. </p>
<p>If you&#8217;ve found JQuery valuable, consider giving something back to the community. And if you haven&#8217;t, you owe it to yourself to check out the latest release with its improved API documentation.</p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2009/01/14/jquery-turns-3/' rel='bookmark' title='Permanent Link: JQuery Turns 3'>JQuery Turns 3</a></li>
<li><a href='http://underground.infovark.com/2009/12/18/introducing-the-sparkserver-project/' rel='bookmark' title='Permanent Link: Introducing the SparkServer Project'>Introducing the SparkServer Project</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/kzLO-vgsJik" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2010/01/15/support-the-jquery-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2010/01/15/support-the-jquery-project/</feedburner:origLink></item>
		<item>
		<title>3 Useful Visual Studio Tricks for Spark Templates</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/3xQmZ_8st2M/</link>
		<comments>http://underground.infovark.com/2010/01/05/3-useful-visual-studio-tricks-for-spark-templates/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 15:33:37 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Spark View Engine]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=558</guid>
		<description><![CDATA[We demonstrate three tricks to improve the Spark template editing experience in Visual Studio 2008. This includes HTML syntax highlighting, Spark file icons, and Visual Studio item templates for Spark views.


Related posts:<ol><li><a href='http://underground.infovark.com/2009/12/09/using-spark-view-engine-with-c-webserver/' rel='bookmark' title='Permanent Link: Using Spark View Engine with C# WebServer'>Using Spark View Engine with C# WebServer</a></li>
<li><a href='http://underground.infovark.com/2009/09/09/visual-studio-2008-and-the-copylocal-setting/' rel='bookmark' title='Permanent Link: Visual Studio 2008 and the CopyLocal setting'>Visual Studio 2008 and the CopyLocal setting</a></li>
<li><a href='http://underground.infovark.com/2009/03/31/visual-studio-2008-and-its-copylocal-setting/' rel='bookmark' title='Permanent Link: Visual Studio 2008 and its CopyLocal setting'>Visual Studio 2008 and its CopyLocal setting</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://sparkviewengine.codeplex.com/WorkItem/View.aspx?WorkItemId=3971">This issue on the Spark discussion board</a> inspired several tweaks to my Visual Studio setup. Gordon and I have found these quite useful, so we&#8217;d thought we&#8217;d share them here.</p>
<h4>Spark template file icons</h4>
<p>First, I made a couple registry files to give Spark templates a spiffy icon.</p>
<p>Visual Studio gets its icons from the same registry setting used in Windows Explorer. So all we need to do is register the file extension and associate it with a default icon.</p>
<p>I found a free-for-noncommercial-use &#8220;S&#8221;-shaped <a href="http://www.iconspedia.com/icon/lightning--580.html">lightning bolt icon</a> and used the instructions in <a href="http://stackoverflow.com/questions/771689/how-can-i-set-an-icon-for-my-own-file-extension">this StackOverflow question</a> to create the necessary registry entries. </p>
<div id="attachment_587" class="wp-caption aligncenter" style="width: 212px"><a href="http://underground.infovark.com/wp-content/uploads/2010/01/VS2008-Spark-icon.png"><img src="http://underground.infovark.com/wp-content/uploads/2010/01/VS2008-Spark-icon-202x300.png" alt="Add an icon for Spark templates in Visual Studio 2008" title="VS2008 Spark icon" width="202" height="300" class="size-medium wp-image-587" /></a><p class="wp-caption-text">Add an icon for Spark templates in Visual Studio 2008</p></div>
<p>You can download the SparkFile.zip package I created from Codeplex. Place the .ico file in C:\Program Files\Spark, and run the two .reg files, and you&#8217;ll have a nifty spark icon inside Visual Studio. </p>
<p>(All the usual caveats apply regarding modifying your registry.)</p>
<h4>Visual Studio template</h4>
<p>Next, I created an item template to use in the Visual Studio Add New Item menu, using this <a href="http://www.switchonthecode.com/tutorials/visual-studio-how-to-create-item-templates">guide to creating item templates</a>. </p>
<p>You can download my SparkVSTemplate.zip package from Codeplex as well. Place the SparkVSTemplate.zip file in <code>My Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C#\Web</code> and you&#8217;ll be able to create a basic template from the VS menu. You don&#8217;t need to unzip it.</p>
<h4>HTML syntax highlighting</h4>
<p>Finally, I wanted to apply the standard syntax highlighting used for HTML pages. </p>
<p>In Visual Studio 2008, go to Tools | Options, then choose Text Editor, then associate files ending in <code>.spark</code> with the HTML editor.</p>
<div id="attachment_559" class="wp-caption aligncenter" style="width: 310px"><img src="http://underground.infovark.com/wp-content/uploads/2009/12/VS2008-Spark-settings-300x184.png" alt="Set up Spark View Engine templates to use the HTML Editor in Visual Studio 2008" title="VS2008 Spark settings" width="300" height="184" class="size-medium wp-image-559" /><p class="wp-caption-text">Set up Spark View Engine templates to use the HTML Editor in Visual Studio 2008</p></div>
<p>This will set all the colors properly. Unfortunately, it will also flag any Spark-specific attributes or elements as HTML validation errors. I figure this is a small price to pay for proper syntax highlighting.</p>
<h4>What&#8217;s missing?</h4>
<p>I&#8217;d really like to <a href="http://dev.dejardin.org/usage/intellisense">get intellisense working Spark</a>. Though I tried the Visual Studio Integration Package, it won&#8217;t work right outside of VS Web projects. Syntax highlighting seems like the best I can do for the moment.</p>
<p>If you&#8217;ve got other tips and tricks for using Spark inside Visual Studio, I&#8217;d love to hear them.</p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2009/12/09/using-spark-view-engine-with-c-webserver/' rel='bookmark' title='Permanent Link: Using Spark View Engine with C# WebServer'>Using Spark View Engine with C# WebServer</a></li>
<li><a href='http://underground.infovark.com/2009/09/09/visual-studio-2008-and-the-copylocal-setting/' rel='bookmark' title='Permanent Link: Visual Studio 2008 and the CopyLocal setting'>Visual Studio 2008 and the CopyLocal setting</a></li>
<li><a href='http://underground.infovark.com/2009/03/31/visual-studio-2008-and-its-copylocal-setting/' rel='bookmark' title='Permanent Link: Visual Studio 2008 and its CopyLocal setting'>Visual Studio 2008 and its CopyLocal setting</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/3xQmZ_8st2M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2010/01/05/3-useful-visual-studio-tricks-for-spark-templates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2010/01/05/3-useful-visual-studio-tricks-for-spark-templates/</feedburner:origLink></item>
		<item>
		<title>Introducing the SparkServer Project</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/NSGnjsBxKSk/</link>
		<comments>http://underground.infovark.com/2009/12/18/introducing-the-sparkserver-project/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 15:27:17 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C# WebServer]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Spark View Engine]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=554</guid>
		<description><![CDATA[It&#8217;s less than two weeks since I began my experiment using the Spark View Engine with C# WebServer. Even though it&#8217;s put a kink in our development schedule, I&#8217;m confident it was the right move. It&#8217;ll save us a lot of time in the long run. After posting messages to the Spark project and C# [...]


Related posts:<ol><li><a href='http://underground.infovark.com/2009/12/09/using-spark-view-engine-with-c-webserver/' rel='bookmark' title='Permanent Link: Using Spark View Engine with C# WebServer'>Using Spark View Engine with C# WebServer</a></li>
<li><a href='http://underground.infovark.com/2010/01/15/support-the-jquery-project/' rel='bookmark' title='Permanent Link: Support the JQuery Project'>Support the JQuery Project</a></li>
<li><a href='http://underground.infovark.com/2009/12/01/looking-for-an-iis-alternative/' rel='bookmark' title='Permanent Link: Looking for an IIS Alternative'>Looking for an IIS Alternative</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s less than two weeks since I began my experiment <a href="http://underground.infovark.com/2009/12/09/using-spark-view-engine-with-c-webserver/">using the Spark View Engine with C# WebServer</a>. Even though it&#8217;s put a kink in our development schedule, I&#8217;m confident it was the right move. It&#8217;ll save us a lot of time in the long run.</p>
<p>After posting messages to the Spark project and C# WebServer project forums, I decided there was enough interest to make sharing my integration code worthwhile.</p>
<p>You can find it at: <a href="http://code.google.com/p/sparkserver/">http://code.google.com/p/sparkserver/</a></p>
<p>If you&#8217;d like to participate in the project, please let me know. Comments, suggestions, and <em>especially</em> fixes are always welcome! </p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2009/12/09/using-spark-view-engine-with-c-webserver/' rel='bookmark' title='Permanent Link: Using Spark View Engine with C# WebServer'>Using Spark View Engine with C# WebServer</a></li>
<li><a href='http://underground.infovark.com/2010/01/15/support-the-jquery-project/' rel='bookmark' title='Permanent Link: Support the JQuery Project'>Support the JQuery Project</a></li>
<li><a href='http://underground.infovark.com/2009/12/01/looking-for-an-iis-alternative/' rel='bookmark' title='Permanent Link: Looking for an IIS Alternative'>Looking for an IIS Alternative</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/NSGnjsBxKSk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2009/12/18/introducing-the-sparkserver-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2009/12/18/introducing-the-sparkserver-project/</feedburner:origLink></item>
		<item>
		<title>Better ways to Encode HTML in C#</title>
		<link>http://feedproxy.google.com/~r/InfovarkUnderground/~3/LehWZNdD9ew/</link>
		<comments>http://underground.infovark.com/2009/12/11/better-ways-to-encode-html-in-c/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 14:30:26 +0000</pubDate>
		<dc:creator>Dean</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[URI]]></category>

		<guid isPermaLink="false">http://underground.infovark.com/?p=547</guid>
		<description><![CDATA[Microsoft provides lots of different ways to encode HTML and URIs, but their newest library, called AntiXSS, is the best of the bunch.


Related posts:<ol><li><a href='http://underground.infovark.com/2009/02/18/using-wcf-to-return-html/' rel='bookmark' title='Permanent Link: Using WCF to return HTML'>Using WCF to return HTML</a></li>
<li><a href='http://underground.infovark.com/2009/01/14/jquery-turns-3/' rel='bookmark' title='Permanent Link: JQuery Turns 3'>JQuery Turns 3</a></li>
<li><a href='http://underground.infovark.com/2008/03/20/using-xmlconvert-for-datetime-strings/' rel='bookmark' title='Permanent Link: Using XmlConvert for DateTime Strings'>Using XmlConvert for DateTime Strings</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Our move from Windows Communication Foundation to C# WebServer once again raised the difficult question of <a href="http://en.wikipedia.org/wiki/HTML_encoding">HTML character encoding</a>. </p>
<p>Since we&#8217;re not using Microsoft IIS, we wanted to avoid a dependency on System.Web, which has the popular but flawed <code>HttpUtility.HtmlEncode()</code> method.</p>
<p>In my research, I discovered Rick Strahl&#8217;s post about <a href="http://www.west-wind.com/Weblog/posts/617930.aspx">Html and Uri String Encoding without System.Web</a>. He points out the problems and inconsistencies in the mainstream encoding methods available in the .NET framework, and ultimately decided to roll his own encoding method.</p>
<p>But in this StackOverflow question on <a href="http://stackoverflow.com/questions/1631819/htmlencode-in-c">HTML Encoding in C#</a>, several folks suggested using Microsoft&#8217;s <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">anti-cross-site scripting</a> library, <a href="http://www.codeplex.com/AntiXSS">AntiXSS</a>.</p>
<p>After spending some time working with the library, it seems like just the thing to solve the problem of web encoding.</p>
<p>The AntiXSS Library includes helpful methods for encoding HTML, URLs, JavaScript, and XML. It&#8217;s based on a secure <a href="http://en.wiktionary.org/wiki/whitelist">whitelist</a> model, so anything not allowed in the specifications is prohibited. </p>
<p>Microsoft has made the source of AntiXSS 3.1 available on Codeplex (http://antixss.codeplex.com/), but you can also get the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=051ee83c-5ccf-48ed-8463-02f56a6bfc09&#038;displaylang=en">official release of AntiXSS</a> direct from Microsoft. It includes a sample application and thorough documentation. </p>
<p>It&#8217;s <em>exactly</em> the solution I was looking for. </p>


<p>Related posts:<ol><li><a href='http://underground.infovark.com/2009/02/18/using-wcf-to-return-html/' rel='bookmark' title='Permanent Link: Using WCF to return HTML'>Using WCF to return HTML</a></li>
<li><a href='http://underground.infovark.com/2009/01/14/jquery-turns-3/' rel='bookmark' title='Permanent Link: JQuery Turns 3'>JQuery Turns 3</a></li>
<li><a href='http://underground.infovark.com/2008/03/20/using-xmlconvert-for-datetime-strings/' rel='bookmark' title='Permanent Link: Using XmlConvert for DateTime Strings'>Using XmlConvert for DateTime Strings</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/InfovarkUnderground/~4/LehWZNdD9ew" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://underground.infovark.com/2009/12/11/better-ways-to-encode-html-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://underground.infovark.com/2009/12/11/better-ways-to-encode-html-in-c/</feedburner:origLink></item>
	</channel>
</rss>
