<?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>Trevor Power &#187; development</title>
	<atom:link href="http://blog.trevorpower.com/index.php/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.trevorpower.com</link>
	<description>Software development and other thoughts</description>
	<lastBuildDate>Wed, 16 Jun 2010 07:17:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Podcast List</title>
		<link>http://blog.trevorpower.com/index.php/podcast-list/</link>
		<comments>http://blog.trevorpower.com/index.php/podcast-list/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 21:52:03 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software craftsmanship]]></category>

		<guid isPermaLink="false">http://blog.trevorpower.com/?p=211</guid>
		<description><![CDATA[I listen to mostly programming podcasts, namely:

Hanselminutes (RSS)
Stackoverflow (RSS)
Herding Code (RSS) &#8211; My favorite by far
Software Engineering Radio (RSS)
.Net Rocks (RSS)
Polymorphic Podcast (RSS)
Deep Fried Bytes (RSS)
Selected items from from IT Conversations (RSS)

Non programming related include:

BrainStuff (RSS) &#8211; These are very short (2-3 minutes)
Stuff You Should Now (RSS)
Astronomy Cast (RSS)
Think Vitamin Radio (RSS)
Science Talk (RSS) &#8211; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fpodcast-list%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fpodcast-list%2F" height="61" width="51" /></a></div><p>I listen to mostly programming podcasts, namely:</p>
<ul>
<li><a href="http://www.hanselminutes.com/">Hanselminutes</a> (<a href="http://feeds.feedburner.com/HanselminutesCompleteMP3">RSS</a>)</li>
<li><a href="http://blog.stackoverflow.com/">Stackoverflow</a> (<a href="http://blog.stackoverflow.com/index.php?feed=podcast">RSS</a>)</li>
<li><a href="http://herdingcode.com/">Herding Code</a> (<a href="http://feeds.feedburner.com/herdingcode">RSS</a>) &#8211; My favorite by far</li>
<li><a href="http://www.se-radio.net/">Software Engineering Radio</a> (<a href="http://feeds.feedburner.com/se-radio?q=rss">RSS</a>)</li>
<li><a href="http://www.dotnetrocks.com/">.Net Rocks</a> (<a href="http://www.pwop.com/feed.aspx?show=dotnetrocks&amp;filetype=master">RSS</a>)</li>
<li><a href="http://polymorphicpodcast.com/">Polymorphic Podcast</a> (<a href="http://feeds2.feedburner.com/PolymorphicPodcast">RSS</a>)</li>
<li><a href="http://deepfriedbytes.com/">Deep Fried Bytes</a> (<a href="http://feeds.feedburner.com/deepfriedbytes">RSS</a>)</li>
<li>Selected items from from <a href="http://itc.conversationsnetwork.org/">IT Conversations</a> (<a href="http://feeds.conversationsnetwork.org/channel/itc">RSS</a>)</li>
</ul>
<p>Non programming related include:</p>
<ul>
<li><a href="http://blogs.howstuffworks.com/category/brainstuff/">BrainStuff</a> (<a href="http://www.howstuffworks.com/podcasts/brainstuff.rss">RSS</a>) &#8211; These are very short (2-3 minutes)</li>
<li><a href="http://blogs.howstuffworks.com/category/stuff-you-should-know/">Stuff You Should Now</a> (<a href="http://www.howstuffworks.com/podcasts/stuff-you-should-know.rss">RSS</a>)</li>
<li><a href="http://www.astronomycast.com/">Astronomy Cast</a> (<a href="http://www.astronomycast.com/feed/">RSS</a>)</li>
<li><a href="http://carsonified.com/blog/">Think Vitamin Radio</a> (<a href="http://feeds.feedburner.com/thinkvitaminradio">RSS</a>)</li>
<li><a href="https://www.scientificamerican.com/podcast/podcasts.cfm?id=science-talk">Science Talk</a> (<a href="http://rss.sciam.com/sciam/science-talk">RSS</a>) &#8211; Scientific American</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/podcast-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharing configuration settings in Visual Studio</title>
		<link>http://blog.trevorpower.com/index.php/sharing-configuration-settings-in-visual-studio/</link>
		<comments>http://blog.trevorpower.com/index.php/sharing-configuration-settings-in-visual-studio/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 20:30:15 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[app.config]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://blog.trevorpower.com/?p=118</guid>
		<description><![CDATA[Correctly managing your systems settings during both development and deployment can save you a lot of time. When ever you have to manually change settings there is the opportunity to mess up, so I try to automate any repetitive configuration tasks.
It often happens that application settings or connection strings are needed by more than one [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fsharing-configuration-settings-in-visual-studio%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fsharing-configuration-settings-in-visual-studio%2F" height="61" width="51" /></a></div><p>Correctly managing your systems settings during both development and deployment can save you a lot of time. When ever you have to manually change settings there is the opportunity to mess up, so I try to <a href="http://blog.trevorpower.com/index.php/2009/02/handling-multiple-web-config-files-in-visual-studio/">automate any repetitive configuration tasks</a>.</p>
<p>It often happens that application settings or connection strings are needed by more than one component in your system. The solution I use is a variation of this method of <a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/04/15/how-to-share-configuration-files-between-projects.aspx">sharing app.config files between applications</a>, except that it allows each project to have its own app.config or web.config files which reference the common settings.</p>
<h2>Creating shared settings</h2>
<p>The first step is to make a settings class that acts as a wrapper around the values in the configuration files. This is a very simple class inheriting ApplicationSettingsBase and looks like this:</p>
<pre name="code" class="c#:nocontrols:nogutter">using System.Configuration;

namespace TP.Example.Configuration
{
    public class Settings : ApplicationSettingsBase
    {
        private static Settings _defaultInstance =
                (Settings)(ApplicationSettingsBase.Synchronized(new Settings()));

        public static Settings Default { get { return _defaultInstance; } }

        [ApplicationScopedSettingAttribute()]
        string ServiceName
        {
            get { return ((string)(this["ServiceName"])); }
            set { this["ServiceName"] = value; }
        }

        [ApplicationScopedSettingAttribute()]
        string EventLogName
        {
            get { return ((string)(this["EventLogName"])); }
            set { this["EventLogName"] = value; }
        }

        [ApplicationScopedSettingAttribute()]
        [SpecialSettingAttribute(SpecialSetting.ConnectionString)]
        string ConnectionString
        {
            get { return ((string)(this["ConnectionString"])); }
            set { this["ConnectionString"] = value; }
        }
    }
}</pre>
<p>The next step is to create the files that contain the settings. I usually have two, one for application settings and one for connection strings. The application settings file consists of a single node matching the full name of my settings class:</p>
<pre name="code" class="xml:nocontrols:nogutter">&lt;TP.Example.Configuration.Settings&gt;
  &lt;setting name="ServiceName" serializeAs="String"&gt;
    &lt;value&gt;My Example Service
  &lt;/setting&gt;
  &lt;setting name="EventLogName" serializeAs="String"&gt;
    &lt;value&gt;ExampleLogName
  &lt;/setting&gt;
&lt;/TP.Example.Configuration.Settings&gt;</pre>
<p>The connection strings file consists of one &#8216;connectionStrings&#8217; node. Note the name of the connection string is qualified with the full name of my settings class.</p>
<pre name="code" class="xml:nocontrols:nogutter">&lt;connectionStrings&gt;
  &lt;add name="TP.Example.Configuration.Settings.ConnectionString" connectionString="[...]" /&gt;
&lt;/connectionStrings&gt;</pre>
<p>These files should exist outside any of your projects but be under source control. I usually put them in a solution folder &#8216;Configuration&#8217; that contains a simple project with the above settings class:<br />
<img class="alignleft size-full wp-image-128" title="'Configuration' solution folder" src="http://blog.trevorpower.com/wp-content/uploads/2009/10/ConfigFolder.png" alt="'Configuration' solution folder" width="351" height="145" /><br clear="all"/></p>
<h2>Referencing shared settings</h2>
<p><img class="alignright size-full wp-image-150" title="Icons have shortcut arrow" src="http://blog.trevorpower.com/wp-content/uploads/2009/10/FilesAsLinks.png" alt="FilesAsLinks" width="326" height="129" />These common settings are now ready to be used by any project in the solution by following these steps:</p>
<ol>
<li>Add a reference to the settings project.</li>
<li>Add a link to settings files and turn on &#8216;copy to output directory&#8217;</li>
<li>Include settings files in the app.config/web.config</li>
</ol>
<p>To link to the settings files you should <em>Add </em>-&gt; <em>Existing Item</em> -&gt; <em>Add As Link</em>, they will then appear with a shortcut icon. This means that they only point to the original file, so there is no duplication.</p>
<p>Now that the files are in our project we just need to get our App.config file to include them. A simplified App.config would look like this:</p>
<pre name="code" class="xml:nocontrols:nogutter">&lt;?xml version="1.0" encoding="utf-8" ?>
&lt;configuration>
  &lt;configSections>
    &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup" >
      &lt;section name="TP.Example.Configuration.Settings" type="System.Configuration.ClientSettingsSection" />
    &lt;/sectionGroup>
  &lt;/configSections>
  &lt;connectionStrings configSource="TP.Example.Configuration.ConnectionStrings.config" />
  &lt;applicationSettings>
    &lt;TP.Example.Configuration.Settings configSource="TP.Example.Configuration.AppSettings.config" />
  &lt;/applicationSettings>
&lt;/configuration>
</pre>
<p>Now when you modify one of these files the change will be picked up by all other projects in the solution.
<p/>
<h2>Websites and Web.config</h2>
<p>Using these settings in a website requires one extra step. As before, the settings file will be linked to by the project file and the &#8216;Copy to Output Directory&#8217; turned on. The problem is that the web.config file is usually at the root while the output directory is &#8216;bin&#8217; or &#8216;bin/Debug&#8217; depending on your setup. Because the output folder can depend on the build configuration, I have found the best solution is to copy the config files from the target directory to the project directory. This is just one line in the build events.<img src="http://blog.trevorpower.com/wp-content/uploads/2009/10/CopyConfigFiles.png" alt="COPY $(TargetDir)*.config $(ProjectDir)" title="COPY $(TargetDir)*.config $(ProjectDir)" width="532" height="267" class="aligncenter size-full wp-image-169" /><br />
Writing it out like this sounds like a lot of work but it is easy to setup and easy to maintain. If you have any question or have a better solution, please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/sharing-configuration-settings-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Craftsmanship</title>
		<link>http://blog.trevorpower.com/index.php/software-craftsmanship/</link>
		<comments>http://blog.trevorpower.com/index.php/software-craftsmanship/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 10:09:00 +0000</pubDate>
		<dc:creator>trevorpower</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[software craftsmanship]]></category>

		<guid isPermaLink="false">http://trevorpower.com/blog/?p=34</guid>
		<description><![CDATA[Most developers I&#8217;ve worked with would have come to me at some point and asked questions like:

What is the best way to implement this new feature?
What do you think of this design, is it good enough?

This to me indicates that software developers in general do take pride in their work and try to achieve the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fsoftware-craftsmanship%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.trevorpower.com%2Findex.php%2Fsoftware-craftsmanship%2F" height="61" width="51" /></a></div><p>Most developers I&#8217;ve worked with would have come to me at some point and asked questions like:</p>
<ul>
<li>What is the best way to implement this new feature?</li>
<li>What do you think of this design, is it good enough?</li>
</ul>
<p>This to me indicates that software developers in general do take pride in their work and try to achieve the first part of the <a href="http://manifesto.softwarecraftsmanship.org/">Manifesto for Software Craftsmanship</a>:</p>
<blockquote><p>Not only working software, but also <strong>well-crafted software</strong></p></blockquote>
<p>Given that most developers are competent enough to come up with good designs and implement them well with nice clean code and generally have the desire to do so, why is this rarely reflected in the resulting code?</p>
<p>The reason, I believe, is related to the second line from the same manifesto:</p>
<blockquote><p>Not only responding to change, but also <strong>steadily adding value</strong></p></blockquote>
<p>The key word here being change. In contrast to my first observation, many developers when working with existing code will try and squeeze in their fix/feature and get out as quickly as possible. If they do come to me to talk about that change it&#8217;s just to grumble and complain about how hard it is to work with that code or how buggy it is.</p>
<p>The next time someone grumbles about some code they are working on I will remind them (or myself) that because they are now working on that code it is now their responsibility, it is up to them to make it better. If you&#8217;re not happy with the code you are working with, think about how the existing code could be changed to make your fix/feature easier to add.</p>
<p>If you&#8217;re not making the code base better, you are making it worse!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorpower.com/index.php/software-craftsmanship/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
