<?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>Tea-Driven Development &#187; asp.net</title>
	<atom:link href="http://blog.mattwynne.net/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mattwynne.net</link>
	<description>Matt Wynne taking it one tea at a time</description>
	<lastBuildDate>Tue, 10 Jan 2012 20:07:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Use Rsync to Copy Your ASP.NET Website</title>
		<link>http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/</link>
		<comments>http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 01:34:29 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux / OS X Newbie Tips]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/</guid>
		<description><![CDATA[If you&#8217;ve ever tried to copy the source files from a Visual Studio 2005 ASP.NET solution, especially if you&#8217;re using TFS and Resharper, you&#8217;ll have probably noticed all great steaming heaps of fluff and nonsense these tools leave all over your hard drive. Not to mention all the built assemblies lurking in your bin/Debug folders. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever tried to copy the source files from a Visual Studio 2005 ASP.NET solution, especially if you&#8217;re using TFS and Resharper, you&#8217;ll have probably noticed all great steaming heaps of fluff and nonsense these tools leave all over your hard drive. Not to mention all the built assemblies lurking in your bin/Debug folders.</p>

<p>If you have a unix/linux/apple machine handy, or have at least had the sense to instal <a href="http://www.cygwin.com/">cygwin</a> or <a href="http://colinux.wikia.com/">coLinux</a> on your quaint old PC, then give this a rumble.</p>

<p><span id="more-44"></span></p>

<p>Prepare a file with the inclusion / exclusion rules for the files / folders you want to copy. For my solution, it looks like this:</p>

<ul>
<li>*.cs</li>
<li>**/lib/<em>.</em></li>
<li>*.csproj</li>
<li>*.sln</li>
<li>*.resx</li>
<li>*.jgp</li>
<li>*.gif</li>
<li>*.gif</li>
<li>*.aspx</li>
<li>*.ashx</li>
<li>*.js</li>
<li>*.ascx</li>
<li>*.config</li>
<li>*.xml</li>
<li>*.txt</li>
<li>*.html</li>
<li>*.htm</li>
<li>*.dbp</li>
<li>*.sql</li>
<li>*/</li>
<li>*</li>
</ul>

<p>There are a few fascinating points to note about this file:</p>

<ul>
<li>The lines that begin with a &#8216;+&#8217; character are include rules.</li>
<li>The second line copies anything in a /lib folder, which is where we keep dependencies in my world</li>
<li>The second-to-last line tells rsync to copy every folder. Without this, the last line would exclude all the folders (rsync works its way through the folder tree recursively) and you&#8217;d never get to the files you&#8217;d mentioned above. Read that bit again, it&#8217;s hard to understand at first, but important.</li>
<li>The last line excludes everything else.</li>
</ul>

<p>Now fire up your terminal, and invoke the magic of rsync:</p>

<p>rsync -av &#8211;exclude-from=files.txt source/Projects/Widgets/ target/Projects/Widgets/</p>

<p>Which means</p>

<ul>
<li>copy <em>a</em>ll files (recursively)</li>
<li>write <em>v</em>erbose output</li>
</ul>

<p>And there you have it. Yet more unix joy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Avoid Spaghetti Execution with the Judicious use of Inline Scripting</title>
		<link>http://blog.mattwynne.net/2007/10/30/avoid-spaghetti-execution-with-the-judicious-use-of-inline-scripting/</link>
		<comments>http://blog.mattwynne.net/2007/10/30/avoid-spaghetti-execution-with-the-judicious-use-of-inline-scripting/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 08:55:03 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[alt.net]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2007/10/30/avoid-spaghetti-execution-with-the-judicious-use-of-inline-scripting/</guid>
		<description><![CDATA[Rob Conery has kicked up a bit of a stink posting about the use of inline scripting in modern ASP.NET apps. I may post more on this subject when I have time, but I had to just weigh in with my support for disciplined use of this technique, which can save you hundreds of pointless [...]]]></description>
			<content:encoded><![CDATA[<p>Rob Conery has <a href="http://blog.wekeroad.com/2007/10/15/crazy-talk-inline-scripting-and-code-behind/">kicked up a bit of a stink</a> posting about  the use of inline scripting in modern ASP.NET apps.</p>

<p>I may post more on this subject when I have time, but I had to just weigh in with my support for disciplined use of this technique, which can save you hundreds of pointless lines of code and execution cycles in a large app if used wisely.</p>

<p>One trick we use is to replace all those silly asp:LinkButton tags with a good ole anchor tag, and a call to a special utility class called LinkBuilder which knows how the site&#8217;s URLs hang together, like so:
<pre>
&lt;a href="&lt;%= LinkBuilder.Show(catalogueItem) %&gt;"&gt;Cancel&lt;/a&gt;</pre>
This sort of markup can hardly be acused of being spaghetti code (the LinkBuilder method has a single line inside it), and means that we avoid what you might call &#8216;spaghetti execution&#8217; when you actually come to spin the thing up.</p>

<p>Think about what a sequence diagram of the equivalent use of an asp:LinkButton with a wired OnClick event would look like. Eugh.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2007/10/30/avoid-spaghetti-execution-with-the-judicious-use-of-inline-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Model-View-Presenter (MVP) Anti-Patterns</title>
		<link>http://blog.mattwynne.net/2007/06/13/mvp-smells/</link>
		<comments>http://blog.mattwynne.net/2007/06/13/mvp-smells/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 19:07:50 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[mvp]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[presenter]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/?p=5</guid>
		<description><![CDATA[As I work with the MVP / Passive View / Humble View pattern more in ASP.NET, I&#8217;m gaining an understanding of some common smells or anti-patterns that can happen when you try to implement this pattern and haven&#8217;t quite grokked it yet. Some of these are problems I&#8217;ve had to pull out of my own [...]]]></description>
			<content:encoded><![CDATA[<p>As I work with the MVP / <a href="http://www.martinfowler.com/eaaDev/PassiveScreen.html">Passive View</a> / Humble View pattern more in ASP.NET, I&#8217;m  gaining an understanding of some common smells or anti-patterns that can happen when you try to  implement this pattern and haven&#8217;t quite grokked it yet. Some of these are  problems I&#8217;ve had to pull out of my own code:
<h3>TOO MANY PRESENTERS SPOIL THE BROTH</h3>
When you re-use a user-control or even just a view interface on different  pages, it&#8217;s tempting to re-use a special  little presenter inside each of those  pages whose sole responsibility is for presenting that usercontrol. If you have  two different flavours of page, you might even put the call to the presenter  into a BasePage.</p>

<p>This is fine as long as those pages need no other pesenter logic, but there  are usually other controls on the page too, and they&#8217;ll need to be presented,  and before you know it you have two or three or a whole crowd of presenters  yelling at different bits of your page, telling them what to do.</p>

<p>Lesson: This is the path of darkness and complexity on the tightrope of your  untestable UI layer. Re-use presenter logic by all means, but do it inside the  presenter layer, where you can test. Everybody say Ahh&#8230; Tests&#8230;</p>

<p>Maxim: No more than one presenter to be constructed per page /  request.
<h3>THE SELF-AWARE VIEW</h3>
Within a request / response cycle, only the Page should be aware of the  existence of a presenter. The HUMBLE VIEW (implemented in a UserControl) does  what it&#8217;s told without any knowledge of who is dishing out the instructions.  Find this smell by looking for UserControls which construct their own private  little presenters, or worse still accept them as properties (usually so that  they can do filthy things like call methods on them &#8211; see ARROGANT VIEW,  below).
<h3>ARROGANT VIEW</h3>
The arrogant view is not only SELF-AWARE, but has the temerity to imagine  that it has the right to give the presenter direct instructions. Thus a  presenter can easily be relegated to nothing more that a PROXY MODEL, with logic  creeping up into the untestable view layer. Find this smell by looking for  presenters which offer public methods. Replace these direct method calls from  view-&gt;presenter with a more humble OBSERVER PATTERN, where the view raises  events containing the relevant information in the EventArgs, and the presenter  reacts accordingly (or decides not to, as is its privilege).
<h3>PRESENTER BECOMES PROXY MODEL</h3>
When you have an ARROGANT VIEW that commits the crime of directly calling  methods on a presenter, you start to see the logic in the presenter thin down to  the point where it becomes little more than a proxy for the &#8216;model&#8217; (in classic  MVC terminology) or service layer. The whole idea of MVP is to delegate the  responsibility of figuring out what to fetch from the service layer and when to  fetch it, so that the view just gets on with displaying whatever the presenter  decides it should display. When an ARROGANT VIEW gets these kind of notions,  logic that belongs in a (testable) presenter is tangled up with display logic in  the view, and it&#8217;s time to roll up your sleeves and refactor.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2007/06/13/mvp-smells/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

