<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Annoyed.ca &#187; S#arp Architecture</title>
	<atom:link href="http://annoyed.ca/category/technology/net/sarp-architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://annoyed.ca</link>
	<description>Life - Technology</description>
	<lastBuildDate>Fri, 30 Mar 2012 21:58:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>My First Extension Method</title>
		<link>http://annoyed.ca/2008/12/27/my-first-extension-method/</link>
		<comments>http://annoyed.ca/2008/12/27/my-first-extension-method/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 05:43:53 +0000</pubDate>
		<dc:creator>Christopher Hyne</dc:creator>
				<category><![CDATA[S#arp Architecture]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://annoyed.ca/2008/12/28/my-first-extension-method/</guid>
		<description><![CDATA[This evening I wrote my first VB.Net extension method while working on my S#arp Architecture based project. I added another overload of the TextBox method (which is itself an extension method, I believe). I wanted to be able to specify &#8230; <a href="http://annoyed.ca/2008/12/27/my-first-extension-method/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This evening I wrote my first VB.Net extension method while working on my S#arp Architecture based project. I added another overload of the TextBox method (which is itself an extension method, I believe). I wanted to be able to specify the size of the text box. One of the existing TextBox methods has the following signature:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">HtmlHelper.TextBox(name <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>, value <span style="color: #0000ff">As</span> <span style="color: #0000ff">Object</span>, htmlAttributes <span style="color: #0000ff">As</span> IDictionary(Of <span style="color: #0000ff">String</span>, <span style="color: #0000ff">Object</span>))</pre>
</div>
<p>I wanted to be able to specify a text box size without having to declare a new IDictionary every time. So I wrote the following extension method:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;Extension()&gt; _
<span style="color: #0000ff">Public</span> <span style="color: #0000ff">Function</span>(html <span style="color: #0000ff">As</span> HtmlHelper, name <span style="color: #0000ff">As</span> <span style="color: #0000ff">String</span>, value <span style="color: #0000ff">As</span> <span style="color: #0000ff">Object</span>, size <span style="color: #0000ff">As</span> <span style="color: #0000ff">Integer</span>)
    <span style="color: #0000ff">Dim</span> attributes <span style="color: #0000ff">as</span> IDictionary(Of <span style="color: #0000ff">String</span>, <span style="color: #0000ff">Object</span>) = <span style="color: #0000ff">New</span> Dictionary(Of <span style="color: #0000ff">String</span>, <span style="color: #0000ff">Object</span>)

    attributes.Add(<span style="color: #006080">"size"</span>, size)

    <span style="color: #0000ff">Return</span> html.TextBox(name, value, attributes)
<span style="color: #0000ff">End</span> Function</pre>
</div>
<p>Neat stuff.</p>
<p>Now I just have to figure out how to create an extension method that will allow me to pass a lambda expression to RedirectToAction().</p>
]]></content:encoded>
			<wfw:commentRss>http://annoyed.ca/2008/12/27/my-first-extension-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Inner Workings of *.vbproj Files: &lt;ProjectTypeGuids&gt;</title>
		<link>http://annoyed.ca/2008/12/23/the-inner-workings-of-vbproj-files-projecttypeguids/</link>
		<comments>http://annoyed.ca/2008/12/23/the-inner-workings-of-vbproj-files-projecttypeguids/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 02:58:26 +0000</pubDate>
		<dc:creator>Christopher Hyne</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[ASP.Net MVC]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[S#arp Architecture]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://annoyed.ca/2008/12/26/the-inner-workings-of-vbproj-files-projecttypeguids/</guid>
		<description><![CDATA[During the conversion of the S#arp Architecture template project from C# to VB.Net I inadvertently broke (at least) one thing: the ability to add ASP.Net MVC items directly to the SharpArch.Web project directly from the &#8220;Add New Items&#8230;&#8221; dialog. This &#8230; <a href="http://annoyed.ca/2008/12/23/the-inner-workings-of-vbproj-files-projecttypeguids/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>During the conversion of the S#arp Architecture template project from C# to VB.Net I inadvertently broke (at least) one thing: the ability to add ASP.Net MVC items directly to the SharpArch.Web project directly from the &#8220;Add New Items&#8230;&#8221; dialog. This led to <a href="http://stackoverflow.com/questions/386548/how-to-enable-aspnet-mvc-item-templates-for-sarp-architecture-project" target="_blank">my first question asked on StackOverflow.com</a> (which I ended up answering myself, 38 minutes later).</p>
<p>Turns out Visual Studio project files can have an element called &lt;ProjectTypeGuids&gt; which contains one or more guids identifying what type of project the file describes. ASP.Net MVC projects have a particular guid specified: <strong>{603c0e0b-db56-11dc-be95-000d561079b0}</strong>.</p>
<p>So I added this guid to both my SharpArch.Web project file and my SharpArch.Controllers project file, and now I can add new MVC template items directly from the &#8220;Add New Item&#8230;&#8221; dialog. Cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://annoyed.ca/2008/12/23/the-inner-workings-of-vbproj-files-projecttypeguids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S#arp Architecture</title>
		<link>http://annoyed.ca/2008/12/19/sarp-architecture/</link>
		<comments>http://annoyed.ca/2008/12/19/sarp-architecture/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 03:57:18 +0000</pubDate>
		<dc:creator>Christopher Hyne</dc:creator>
				<category><![CDATA[ASP.Net MVC]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Fluent NHibernate]]></category>
		<category><![CDATA[NUnit]]></category>
		<category><![CDATA[Rhino Mocks]]></category>
		<category><![CDATA[S#arp Architecture]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://annoyed.ca/2008/12/19/sarp-architecture/</guid>
		<description><![CDATA[I&#8217;ve been poking around in the latest release of the S#arp Architecture over the last couple days. I like what I see. Pronounced &#8220;Sharp Architecture,&#8221; this is a solid architectural foundation for rapidly building maintainable web applications leveraging the ASP.NET &#8230; <a href="http://annoyed.ca/2008/12/19/sarp-architecture/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been poking around in the latest release of the <a href="http://code.google.com/p/sharp-architecture/" target="_blank">S#arp Architecture</a> over the last couple days. I like what I see.</p>
<blockquote><p>Pronounced &#8220;Sharp Architecture,&#8221; this is a solid architectural foundation for rapidly building maintainable web applications leveraging the ASP.NET MVC framework with NHibernate.</p>
</blockquote>
<p>This evening I took about an hour and converted the basic starter solution template from C# to VB.Net. Why? Well, for the following reasons:</p>
<ol>
<li>While I can work with C# well enough, I&#8217;m much more familiar with VB.Net, which I am required to use at my 9 to 5 job. I tend to stick with VB.Net even for my personal projects for simplicity. Anything I learn on my own I can easily apply at work.</li>
<li>It gave me an opportunity to confirm that I understand (at least at a high level) what the S#arp Architecture is doing.</li>
</ol>
<p>The conversion was straight forward. Pretty well every line of C# had a corresponding line in VB.Net. The only thing I had to add was an Imports tag in the markup of the Site.Master page in order to get the ActionLink and Image extension methods to resolve. I had already tried adding an imports to the code-behind with no luck. Not sure why that was necessary, but it worked.</p>
<p>The architecture is pretty neat. Here&#8217;s a few things I&#8217;ve noted already:</p>
<ul>
<li>The Models, Views and Controllers (I.e. the M, V and C in MVC) are each in their own projects.</li>
<li>The Repository/IRepository pattern is used, with the Interfaces defined in the same project as the Models, and the Repository implementation(s) in a separate project.</li>
<li>Includes support for NUnit, Castle Windsor, (Fluent) NHibernate, and Rhino Mocks</li>
<li>The ASP.Net MVC routes are defined in the Controllers project, not in the Global.asax of the Web/Views project. Excellent separation of concerns!</li>
</ul>
<p>I&#8217;m going to go ahead and trying putting together an actual application based on S#arp Architecture.</p>
]]></content:encoded>
			<wfw:commentRss>http://annoyed.ca/2008/12/19/sarp-architecture/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

