<?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>Gojko Adzic &#187; subversion</title>
	<atom:link href="http://gojko.net/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://gojko.net</link>
	<description>Building software that matters</description>
	<lastBuildDate>Tue, 31 Jan 2012 09:07:39 +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>Introduction to Subversion for .NET Developers</title>
		<link>http://gojko.net/2008/08/04/introduction-to-subversion-for-net-developers/</link>
		<comments>http://gojko.net/2008/08/04/introduction-to-subversion-for-net-developers/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 21:24:47 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[presentations]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[alt.net]]></category>
		<category><![CDATA[ankhsvn]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[tortoisesvn]]></category>
		<category><![CDATA[visualsvn]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=184</guid>
		<description><![CDATA[I presented a 15 minute introduction to Subversion during the Alt.NET Community on Alternative .NET tools evening last week. The video should appear online soon at the Skills Matter site. Here is the talk in a more readable form meanwhile. Subversion is my favourite version control system. I&#8217;ve been using...]]></description>
			<content:encoded><![CDATA[<p><img src="/images/svn_intro.jpg" style="width:281px;margin:5px 5px 5px 5px; border:1px solid black;" align="left"/><i>I presented a 15 minute introduction to Subversion during the <a href="http://gojko.net/2008/08/01/altnet-evening-on-alternative-net-tools-comments-and-links/">Alt.NET Community on Alternative .NET tools</a> evening last week.  The video should appear online soon at the Skills Matter site. Here is the talk in a more readable form meanwhile.</i> </p>
<p>Subversion is my favourite version control system. I&#8217;ve been using it for about two years now (I first wrote about it first in <a href="http://gojko.net/2007/04/17/three-months-in-the-sub/">april &#8217;07</a>) and so far I am very happy with it. It was built as a replacement for CVS, which was the standard version control system in the Unix/Linux world and more or less de facto standard for opensource projects at the time when Subversion was started (sometime in 2000). Subversion took the best ideas from CVS, added some very interesting concepts and solved most of the problems that people had with CVS (but not all of them). It is now the typical choice for any new Java projects and replaced CVS as the standard version control system in most of the opensource projects. Over the last few years, it is becoming more and more popular for Windows .NET projects as well.<span id="more-184"></span></p>
<h2>Lots of tools for Subversion</h2>
<p><img src="/images/svn_tools.jpg" style="width:400px;margin:5px 5px 5px 5px; border:1px solid black" align="left"/>CVS was never really popular among developers working on Microsoft Windows because of poor tool support. SVN, on the other hand, has very good support for Windows. In fact, good tool support is one of the best things about Subversion. Since it is used on so many operating systems and for so many development platforms, Subversion has quite a few tools that you can use. The default one that comes with the basic installation is the command line tool, which gives you full control of the system but it is not really what is normally considered user friendly. Even if you are not used to command line tools, I suggest looking into it because it will help you automate tasks. A very interesting Windows tool is TortoiseSVN, an opensource plugin for Windows explorer that allows you to perform all operations with Subversion from the normal Windows file window using a right-click context menu. TortoiseSVN is a great tool for people that do not want to use an IDE or learn another tool, such as business analysts that just want to check-in and check-out acceptance tests. It is also useful for database developers that use IDEs such as TOAD which have no concept of version control. </p>
<p>Two another very important tools for .NET developers are AnkhSVN and VisualSVN. AnkhSVN is an opensource plugin for Visual Studio which enables you to perform version control operations from the IDE. I use the command line SVN tool for everything, so I&#8217;m not really the best person to tell you about ins and outs of AnkhSVN. I evaluated it the last time more than a year ago, and it was not really functionally complete but it could do the basic operations. Apparently it has been significantly improved over the last few months. If AnkhSVN does not do the job for you, try VisualSVN, a commercial Visual Studio plugin that integrates SVN as a source code control system into Visual Studio. It&#8217;s not very expensive, and should have all the functions that you might need. Again, this is just from what I&#8217;ve heard, I do not use it myself.</p>
<p>A tool that is especially interesting for me is ViewVC. ViewVC is a web front-end to Subversion, running on Apache. It will give you proper read-only access to a SVN repository using a browser, so it is very useful to look at the changes or code from a machine that does not have SVN installed. In the past, I used this to give the support team access to the code and deployment history. Subversion itself can provide HTTP access using Apache, without additional tools, but you need to remember a lot of cryptic URL commands for that. ViewVC gives you a point-and-click interface to browse revision history, see colour-coded differences between versions and browse through the repository. For a live demo, see the <a href="http://dbfit.svn.sourceforge.net/viewvc/dbfit/dbfit/" target="_blank">dbfit</a> project repository on Sourceforge.</p>
<p>In general, you&#8217;ll find that opensource tools have great support for Subversion. Cruise Control .NET, for example, supports Subversion out of the box even for initial checkout and labeling. Team System support is <a href="http://confluence.public.thoughtworks.org/display/CCNET/Source+Control+Blocks" target="_blank">still incomplete</a>. So if you want to use lot of .NET opensource tools in your process, putting the code on Subversion makes a lot of sense.</p>
<h2>Subversion is atomic</h2>
<p><img src="/images/svn_atomic.jpg" style="width:400px;margin:5px 5px 5px 5px; border:1px solid black" align="left"/>The best feature of Subversion is atomic commit. That means that the whole change set is either going to succeed completely or fail, regardless of how many files there are in that set. For example, if you did a big refactoring of the source code and want to commit 50 files, but the 47th commit fails because someone else modified that file meanwhile, changes to the first 46 files will be rolled back on the server and you&#8217;ll be asked to resolve the problem before committing again. If the commit went through partially, the build would fail on the server and you would have to check what was committed and what failed. So the atomic commit solves a lot of consistency issues that happen with some other version control systems. </p>
<p>There are two more important things to know about those atomic versions. First is that the whole repository has a unique version sequence, incremented on every commit. Second is that Subversion stores only differences between versions for text files in the change log. These two features have some interesting implications. For start, you don&#8217;t have to remember to tag important versions. Version completed by each commit is assigned a unique number, and you can easily use that number to download the snapshot of how files looked like at that point in time. On .NET projects, I use this as the DLL version. When you need to troubleshoot, right-click on the DLL, see the version number and then you can easily checkout the exact source of that code version.  Another important thing coming out from storing only the differences in files is that tagging and branching effectively does very little &mdash; it just creates a new revision without modifying any files. So you can easily tag or branch 50 MB of files in a millisecond. </p>
<h2>Subversion works smart</h2>
<p><img src="/images/svn_smart.jpg" style="width:400px;margin:5px 5px 5px 5px; border:1px solid black" align="left"/>Subversion has many smart functions that make it a very good choice for a development version control system. It really helps to automate some of dull tasks.</p>
<p>Storing differences in text files and automatic versions allow Subversion to provide one very interesting auditing function. Called “blame”, this function lists a file with every line marked with the last change version and the person who changed it. (This is available on the web frontend viewvc as well &mdash; see a live demo again on <a href="http://dbfit.svn.sourceforge.net/viewvc/dbfit/dbfit/impl/java/src/dbfit/util/DataRow.java?view=annotate" target="_blank">Sourceforge</a>). </p>
<p>Since versions are stored as differences, we can easily roll back any particular version by reversing the differences, without affecting any other changes. Similar to that, we can take a particular set of differences (eg changes to a branch) and then apply it to different files (eg main branch). So Subversion makes merging branches relatively easy. </p>
<p>Subversion is also smart enough to understand that it is rarely the only tool applied to a project, so it does not require you to check-out large branches in order for tools that don&#8217;t know about Subversion to work correctly. It will find new or missing files and folders and appropriately suggest adding or removing those from the repository. Subversion works in edit-and-merge mode which means that two people can work on the same file at the same time, as long as they do not change the same line, and it will be able to merge the changes correctly. </p>
<p>The only real problem with Subversion, also inherited from CVS, is that it is a folder-based system, which means that it will store meta-data in a hidden .svn folder inside your folders. If you rename or copy a folder that was committed to the version control, you will also copy the meta-data files but they are no longer correct. So changing something and committing back will actually change the old location on the version control server. Renaming and moving individual files is not a problem, but with folders it is much more complicated. That&#8217;s where TortoiseSVN can help again, since you get the subversion rename, copy and move functions basically in the same menu as the normal ones, so you just have to remember to click on the correct option.</p>
<h2>Links for the end</h2>
<p>Here are some links to download tools or look for more information:</p>
<ul>
<li><a href="http://subversion.tigris.org" target="_blank">Main subversion site</a></li>
<li><a href="http://ankhsvn.com" target="_blank">AnkhSVN</a></li>
<li><a href="http://tortoisesvn.tigris.org" target="_blank">TortoiseSVN</a></li>
<li><a href="http://www.visualsvn.com" target="_blank">VisualSVN</a></li>
<li><a href="http://www.viewvc.org" target="_blank">ViewVC</a></li>
</ul>
<p><b>Image credits:</b> <a href="http://flickr.com/photos/samuraidunny/230628777/" target="_blank">Locomoco</a>, <a href="http://flickr.com/photos/detroitderek/2355218521/" target="_blank">Derek Farr</a>, <a href="http://flickr.com/photos/7969902@N07/511103951/" target="_blank">Pierre J.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2008/08/04/introduction-to-subversion-for-net-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alt.Net evening in London</title>
		<link>http://gojko.net/2008/07/17/altnet-evening-in-london/</link>
		<comments>http://gojko.net/2008/07/17/altnet-evening-in-london/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 14:48:49 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[presentations]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[alt.net]]></category>
		<category><![CDATA[catle]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[nservicebus]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[rhino]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=150</guid>
		<description><![CDATA[We are organising a gathering of Alt.Net enthusiasts on the 31st this month at Skills Matter offices. We&#8217;ll do seven talks in total with beer and pizza during the break, and then go out for beers and socialising. Here&#8217;s the programme for the talks: NHibernate &#8211; Ian Cooper PowerShell &#8211;...]]></description>
			<content:encoded><![CDATA[<p>We are organising a gathering of Alt.Net enthusiasts on the 31st this month at Skills Matter offices. We&#8217;ll do seven talks in total with beer and pizza during the break, and then go out for beers and socialising. Here&#8217;s the programme for the talks:</p>
<p>NHibernate &#8211; Ian Cooper<br />
PowerShell &#8211; Zi Makki<br />
OpenRasta &#8211; Sebastian Lambla<br />
Castle Windsor &#8211; Mike Hadlow<br />
Rhino Mocks &#8211; Chris Roff<br />
NServiceBus &#8211; David De Florinier<br />
Subversion &#8211; Gojko Adzic</p>
<p>The event is free but the number of places is limited. Apparently about half of the places are already taken and Skills Matter have not yet started to advertise it seriously, so if you were planning to come to the event make sure to register soon. For more info and to register <a href="http://skillsmatter.com/event/open-source-dot-net/alternative-tools-for-dot-net-development">click here</a>.</p>
<p>See you on 31st. </p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2008/07/17/altnet-evening-in-london/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three months in the Sub</title>
		<link>http://gojko.net/2007/04/17/three-months-in-the-sub/</link>
		<comments>http://gojko.net/2007/04/17/three-months-in-the-sub/#comments</comments>
		<pubDate>Tue, 17 Apr 2007 13:16:35 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://gojko.net/2007/04/17/three-months-in-the-sub/</guid>
		<description><![CDATA[I like to periodically shake-up the version control, re-align it with the way the project is going and clean up any clutter. As it was time to split one big project into several more-less separate tracks, I ran into an article announcing the release of version 1.0 of AnkhSVN, a...]]></description>
			<content:encoded><![CDATA[<p><img src="/images/142624_submarine_at_rest_2.jpg" style="margin:5px 5px 5px 5px; border:1px solid black;" align="left" /> I like to periodically shake-up the version control, re-align it with the way the project is going and clean up any clutter. As it was time to split one big project into several more-less separate tracks, I ran into an article announcing the release of version 1.0 of AnkhSVN, a free subversion plugin for Visual Studio. AnkhSVN had proper solution browser integration, and a &#8216;working copy explorer&#8217;, very much like the Eclipse synchronise screen. It looked very promising, so we decided to try it out. </p>
<p>I read a lot about Subversion, but never really had a reason to move from CVS – there was no new killer feature. We were generally satisfied with CVS, with just one problem. Integration with Visual Studio was virtually non existent. In January, <a href="/2007/01/21/enterprise-net-toolkit-unusual-suspects/#comments">several readers suggested trying out Subversion instead of CVS</a>, and shortly after I took their advice. It turns out that the killer application, that made us move to Subversion, was the Visual Studio Plugin. <span id="more-46"></span></p>
<h2>Migration from CVS</h2>
<p>The migration from CVS was relatively easy. Subversion does edit-and-merge like CVS, works good over WAN lines, has proper GUI client tools for Windows and a command-line interface for easy scripting. </p>
<p>In terms of usage, two biggest differences from CVS for me were attributes and the branching system. In CVS, files are ignored just by adding their name to .cvsignore. Subversion does that with directory properties (use propset option from the command line).  We migrated the repository quickly with a small shell-script that ran through the repository tree and loaded .cvsingnore into directory properties. </p>
<p>Branches and tags are just copies in Subversion. This makes branching somewhat simpler, as just a part of the repository can be copied (and branched), without affecting the rest. However, at first I had big reservations regarding tags as copies. With CVS, I used tags to mark a release or a significant starting point before a big change, so that I could easily go back. I thought that copying would just take too long and that it would take too much space. However, it turns out that copying in Subversion is not physical – a new branch or tag is created with a simple atomic operation that just sets up a link from the new location to the current version (from that point, of course, the copy can be modified independently). </p>
<p>Subversion also has automatic versioning of the complete repository, not just per file. Each commit operation is assigned a unique version number – this pretty much takes care of marking important savepoints, as we can go back and take the whole repository in a specific version. Although we could theoretically use these numbers to track releases, I still like to tag released files and give them a sensible descriptive name, instead of remembering that last iteration was 1182. </p>
<h2>From the user perspective</h2>
<div style="margin:5px 5px 5px 5px; float:right; border-top:1px solid black; border-left:1px solid black; border-bottom:2px solid black; border-right:2px solid black; background-color:rgb(244,244,244); padding:5px 5px 5px 5px;">
<h2>Essential tools</h2>
<ul>
<li>SVN <a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91" target="_blank">windows client</a></li>
<li><a href="http://subclipse.tigris.org/" target="_blank">SubEclipse</a> plugin for Eclipse</li>
<li><a target="_blank" href="http://ankhsvn.tigris.org/servlets/ProjectDocumentList?folderID=7315&#038;expandFolder=7315&#038;folderID=1003">ANKHSvn  </a> plugin for Visual Studio <br />(requires windows client)</li>
<li><a href="http://tortoisesvn.tigris.org/" target="_blank">TortoiseSVN  </a>plugin for Windows file explorer</li>
<li><a href="http://www.viewvc.org">ViewVC</a> &#8211; browser based repository interface</li>
</ul>
</div>
<p>Subversion has quite a few features not present in CVS. Most importantly, SVN does atomic commits (so the entire batch of related updates will fail or succeed), and can work natively over HTTP, so you instantly get a web-based interface just for browsing. Automatic versioning allows the system to keep track of which line was changed by whom in which revision, and that information is easily accessible as the &#8216;blame&#8217; feature (maybe not the best name, but it makes a point). File renaming and moving are also versioned, so Subversion does not get in the way of refactoring.</p>
<p>In terms of client software, the Eclipse plugin for SVN looks and behaves very much like the CVS plugin (with a few added functions), but I did not see any major differences between them. </p>
<p>On Windows, we are using TortoiseSVN, a free plugin which provides access to the repository from the windows file explorer. It works very similar to TortoiseCVS, but has a few added functions for differences and merging.</p>
<p>AnhkSvn turned out to be a very interesting tool, providing direct integration with SVN from visual studio. In terms of features and performance, Tortoise seems better, so we tend to use both. AnhkSVN is good for files being developed in Visual studio, as it automatically adds new source files to the repository and gives us quick visual feedback of what was changed in the whole project tree. The only “problem�? I have run into is when it stops renaming files which were added but not yet committed. I occasionally change my mind about the class name (and file name) soon after a new file is created, and file renaming just silently dies when AnkhSVN is turned on. This was a bit frustrating at first, but once I realised what the problem is, it was not hard to work around it. All in all, very useful. </p>
<p>An important feature for us was also the integration with Cruise<br />
Control.Net. Since version 1.2, CC.Net can automatically check out source folders from SVN (even the initial checkout, which is not available for CVS), and can tag successful builds.</p>
<h2>From the admin perspective</h2>
<p>SVN repository setup is straight-forward, like CVS, but there are quite a few options how to set up the whole system, so analyse them carefully if you are thinking about moving to subversion. </p>
<p>SVN does not have modules, like CVS, but allows the users to check out individual directories. Tags and branches complicate things a bit, because they are also accessed directly from the main file structure (they are just copies of files). With all this flexibility, it&#8217;s important to structure the repository so that people can check-out only relevant parts. This typically means that the top-repository level should be divided straight away into branches, releases, automated builds and the current working copy (called trunk in SVN language). We missed that one – and decided to structure the repository first by sub-projects and then do a division between source, branches and tags on the second level. It turned out that this made it hard to check out all related projects quickly. The next time we shake-up the repository, the first level will probably provide a division between trunk and copies, and projects will be on the second level.</p>
<p>SVN has two options for repository storage – individual files (similar to CVS) or an embedded database. Apparently, the first is a bit slower for access, but supports online backups and can be repaired easier in case of problems. We chose to use files, and (luckily) so far did not need to test the proposition that files can survive crasher easier. As for performance, it was quite good with files, so I don’t think that we will be moving to the database any time soon.</p>
<p>There are also several options for remote access. SVN has a binary protocol (which can work over SSH) and there is an Apache plugin which provides HTTP(S) support. Our version control server runs on Linux, and we decided to use Apache for several reasons:</p>
<ul>
<li>easier disk privilege management – entire repository is owned by a single user on server, access controls are handled by Apache</li>
<li>new users can be added easier – they do not have to be system users, but are just defined in a httpd users file</li>
<li>access control lists can be specified for a part of the hierarchy, and all ACL lists are in a single file, easy to control</li>
<li>HTTP server automatically allows repository browsing </li>
<li>Theoretically, having multiple users access the repository through a single funnel (in this case HTTP server) will reduce the chance of file corruption. </li>
</ul>
<p>There are a few other advantages of working over HTTP like support for online GZip traffic compression. Again, the performance was quite satisfactory, both on the local network and on WAN lines. It would probably run faster with a binary protocol, but isolating under an Apache module makes the repository much easier to manage.</p>
<p>Although Apache module itself provides support for repository browsing, we also installed viewvc, a better Web-based interface which displays last modifications and provides basic support for checking differences online. </p>
<h2>The story so far</h2>
<p>So far, I am happy with Subversion and what it has done for us. The only real problem we encountered in these three months is bailing out after something was committed by mistake. With CVS, repairing the problem would be simply checking out a tagged revision, then committing over the repository again. SVN makes this quite hard because it remembers the revision you checked out, so it’s not easy to override the current version with an older one. So far, we had to deal with this situation three or four times, by copying the old revision to an external location, checking out the latest version, then copying files from the external location by hand. I guess that there is a better solution for this problem, but so far I did not find it.</p>
<p>As it has atomic commits, theoretically it should not be too hard to make Subversion roll back the last revision, and that functionality would make it, from my point of view, very close to an ideal version control system. I would certainly recommend evaluating it if you are shaking up the current version control, or starting a new project.</p>
<p>Image credits:  <a target="_blank" href="http://www.sxc.hu/profile/sick31">Sick 31/SXC</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2007/04/17/three-months-in-the-sub/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Enterprise .Net Toolkit: Unusual Suspects</title>
		<link>http://gojko.net/2007/01/21/enterprise-net-toolkit-unusual-suspects/</link>
		<comments>http://gojko.net/2007/01/21/enterprise-net-toolkit-unusual-suspects/#comments</comments>
		<pubDate>Sun, 21 Jan 2007 18:22:31 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[alt.net]]></category>
		<category><![CDATA[castle]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://gojko.net/2007/01/21/enterprise-net-toolkit-unusual-suspects/</guid>
		<description><![CDATA[It&#8217;s been almost a year since I got involved in a big .Net enterprise project. My first choice would be to do it mostly in Java, but due to politics, or lack of better judgement, .Net was a given constraint. We pushed the technology to it&#8217;s limits and found out...]]></description>
			<content:encoded><![CDATA[<p><img src="/images/604255_old_toolbox.jpg" style="margin:5px 5px 5px 5px; border: 1px solid black" align="left"/>It&#8217;s been almost a year since I got involved in a big .Net enterprise project. My first choice would be to do it mostly in Java, but due to politics, or lack of better judgement, .Net was a given constraint. We pushed the technology to it&#8217;s limits and found out that some popular tools were just not cut out for that job. However, I&#8217;ve also learned that if you dig deep enough, there are some very promising tools for .Net on the Net.</p>
<p>Looking back, the .Net developement landscape is far from ideal – our choices left us with a working environment, and enabled us to get the job done, but with a lot of bumps on the road. From my perspective, .Net is still three or four years behind Java in terms of platform maturity and available tools for enterprise application development. The core development concepts are there, but .Net lacks the support which Java has with a vast number of independent enterprise frameworks, servers and libraries. A lot of popular Java libraries and tools have been ported to .Net, but are often much less stable, or complete, than the originals. But, even though they do not shine brightly yet, there are some rising stars.  <span id="more-29"></span></p>
<h2>Development tools</h2>
<p>The standard development IDE for .Net seems to be Visual Studio. I became test-infected about five years ago, and would not give that up for anything, but Visual Studio offers integrated unit testing only in the Team Suite version (the company had only a Professional VS license, so the IDE had no unit-test support).  <a target="_blank" onClick="javascript:urchinTracker('/links/nunit');" href="http://www.nunit.org/">NUnit</a> performed quite well for our unit testing requirements, but it had to be run externally, and there was no <i>click-on-exceptions-inspect-code</i> support, which I got used to in Eclipse. Also, VS can perform only basic refactorings, and for me good refactoring support is one of the fundamental features for a modern IDE. So we tried to find a replacement.</p>
<p><a target="_blank" onClick="javascript:urchinTracker('/links/eclipsesharp');" href="http://www.improve-technologies.com/alpha/esharp/">Improve C# plugin</a> for Eclipse offered content-assistance only for C# keywords, without even trying to fetch method names or parameters with reflection, so we quickly discarded it. We then tested <a target="_blank" 	onClick="javascript:urchinTracker('/links/sharpdevelop');" href="http://www.icsharpcode.net/opensource/sd/">Sharp-Develop</a>, an open-source IDE for C# &#8211; which offers NUnit and NAnt integration and VS project-file compatibility. However, it is still in an infant stage &#8211; it simply had too many bugs and did not offer enough customization to be useful on this project. I see big potential in Sharp Develop, and really think that it can become the Eclipse of .Net if more effort is put into it, but it was not for us at this time. As bad as Visual Studio is as and IDE, it is still the best there is for .Net.</p>
<p>As we could not find a replacement for VS, we looked for a way to improve it. It seems that we were not the only ones with the same problem, and JetBrains tried to cash in on the &#8216;<i>unhappy eclipse developer in .net world</i>&#8216; market. They offer a plug-in for Visual Studio which makes it more Eclipse-user friendly, called <a target="_blank" onClick="javascript:urchinTracker('/links/resharper');" href="http://www.jetbrains.com/resharper/">Resharper</a> &#8211; it&#8217;s not free, but not too expensive either (200 USD). It offers NUnit and NAnt integration, a decent set of refactorings, search and navigation improvements, and after testing the free version we decided to buy about twenty licenses. On the end, it turned out to be a sweet and sour mix &#8211; it significantly slows down Visual Studio, leaves crap files in the project source (even if you tell it five times to save it&#8217;s cache in system temporary folders), and reports false compile errors when a DLL project reference is removed. Some refactorings don&#8217;t work correctly, especially looking for interface references. Several of our developers have uninstalled it, since it has too many bugs. I still use it, because the basic Visual Studio refactoring set is just not enough for me to do my work, and I live with the false compile errors and take care when checking-in files into CVS, but I am far from happy.</p>
<p>For the build scripts, we decided to use both MSBuild and <a target="_blank" onClick="javascript:urchinTracker('/links/nant');" href="http://nant.sourceforge.net/">NAnt</a> on the end. NAnt scripts are much more readable and maintainable, which is important for packaging, so we decided to keep using MSBuild for development, but use NAnt for packaging. Although that means  doubling the effort to write build scripts, we have both the benefits of IDE-integrated build and flexible packaging. </p>
<p>For integration and acceptance testing, we use <a target="_blank"  onClick="javascript:urchinTracker('/links/fitnesse');" href="http://www.fitnesse.org">FitNesse</a>. FitNesse .Net integration <a href="/2007/01/01/getting-fit-with-dotnet/">was a bit tricky to set up</a>, and we had to hack the code to get it working with nullable types and correct a few other minor bugs, but it is now an indispensable tool for our project. It can test both Java and .Net code and cut through technological boundaries. Together with <a target="_blank"  onClick="javascript:urchinTracker('/links/selenium');" href="http://www.openqa.org/selenium/">Selenium</a> it can even test the system end-to-end – populating Web fields and submitting forms, then checking the results in the database.</p>
<h2>Version control</h2>
<p>The standard version control system in a .Net environment is Visual Source Safe. But that crap was never, as far as I am concerned, a proper version control system. It cannot recognise a modified file unless it was checked out, and works properly only on a LAN. Visual Studio 2005 has a new source control system, but that&#8217;s supported only in the Team Suite version, which the company did not have. <a target="_blank" onClick="javascript:urchinTracker('/links/sos');" href="http://www.sourcegear.com/sos/index.html">Source off site</a> solves the remote access problem for VSS, but this project has a mix of technologies and it was really important for us to have the version control working properly, and not get in the way, even without Visual Studio. Good-old CVS was installed on a Linux machine, but Visual Studio (of course), did not support that out of the box. We tried the <a target="_blank" 	onClick="javascript:urchinTracker('/links/igloo');" href="http://www.jalindi.com/igloo/">Igloo</a> Visual Studio plugin for CVS, but it simply did not live up to our expectations – it lacks support for some basics like visual notifications of changed files, and requires too much manual work. <a target="_blank" onClick="javascript:urchinTracker('/links/tortoise');" href="http://www.tortoisecvs.org/">Tortoise CVS</a> is an interesting solution for the problem &#8211; it is a free CVS plugin for Windows Explorer, which enables you to check files in and out of a CVS repository from the folder window. It has a few quirks, especially disconnecting and re-connecting to CVS for every folder, but it works good enough. Some developers actually use Eclipse even for the .Net source-code control. So, we still lack version control-IDE integration, but it&#8217;s the lesser of two evils.</p>
<h2>Application framework</h2>
<p>Comming from a Java-centric environment, my first stop were ports of &#8216;standard&#8217; Java frameworks and libraries &#8211; <a target="_blank" onClick="javascript:urchinTracker('/links/springnet');" href="http://www.springframework.net/">Spring.Net</a> and <a target="_blank" 	onClick="javascript:urchinTracker('/links/log4net');" href="http://logging.apache.org/log4net/">Log4Net</a>. Spring.Net turned out to be, at least six months ago, just a glorified configuration engine. It lacked any notion of a proper MVC web framework, which was crucial to the project, and with all it&#8217;s dependencies, it was a bit too heavy for just an IoC configuration loader. We decided to use Spring.Net for dependency injection, and write our own MVC, but then it all fell apart under heavy load. Spring.Net depends on Log4Net, and Log4Net turned out to be a big risk &#8211; under initial stress testing, when the services crashed, we lost the last few log entries (which were, considering the situation, the only ones important). We spent some time trying to make it flush logs after each entry, without success, and just gave up. So using Log4Net, and with it Spring.Net, was out of the question &#8211; there was no point in having two log engines in the same project, and Spring.Net could not use anything else.</p>
<p>My next stop was <a target="_blank" onClick="javascript:urchinTracker('/links/msentlib');" href="http://msdn.microsoft.com/practices">Microsoft Enterprise Library</a>, a collection of free add-ons to the .Net framework intended to provide standard services. Among the &#8216;application blocks&#8217;, which is Microsoft&#8217;s name for components, we found a proper logging engine. It performed OK under heavy load, and had an API similar to Log4J, so it was a serious candidate. Digging through the code we found that the Enterprise Library actually had an inversion of control engine (called <a target="_blank" onClick="javascript:urchinTracker('/links/ob');" href="http://www.codeplex.com/ObjectBuilder">Object Builder</a>, later released on CodePlex), but it still left us without a good Web MVC system. We had some  <a href="/2006/11/19/license-wars/">doubts about Object Builder license</a>, but if the Enterprise Library had a good lightweight MVC, we would have probably used it.</p>
<p>Meanwhile, we experimented with some other logging frameworks, and <a target="_blank" 	onClick="javascript:urchinTracker('/links/nlog');" href="http://www.nlog-project.org">NLog</a> passed all our tests &#8211; in addition to performing well under heavy load, Log4J-like configuration and API, it also had a fairly flexible appender support (NLog calls them targets), and can add contextual information to log entries.</p>
<p>Then we found <a target="_blank" onClick="javascript:urchinTracker('/links/castle');" href="http://www.castleproject.org">Castle Project</a>, a lightweight application container intended to be a mix between Ruby&#8217;s flagship application Rails and Spring Framework. It has a good inversion of control engine, and a proper lightweight Web MVC. Castle is very open to integrations, so it can use NLog in addition to Log4Net out of the box. Although the framework is still a &#8216;release candidate&#8217;, it works stable and did not give us any problems. The configuration files are very similar to Spring, and Castle tries to resemble Spring in other areas, so the learning curve was quite short for us. </p>
<p>Castle&#8217;s Web MVC is configured partly in code and partly in external files &#8211; things like aspect-like filters and web folders, which Castle calls &#8216;areas&#8217;, are configured as class attributes rather than in configuration files &#8211; which significantly limits re-use of MVC controller code. I would really like to see this moved to external files, but other that that, Castle MVC works quite fine. It can use several rendering engines, including <a target="_blank" onClick="javascript:urchinTracker('/links/nvelocity');" href="http://nvelocity.sourceforge.net/">NVelocity</a>, Web Forms and Brail (templates in Boo). It does not currently support XSLT, but has a pluggable rendering architecture, so I am still thinking about whether we should write that plug-in ourselves. Meanwhile, we use NVelocity with great success.</p>
<h2>Rising stars</h2>
<p><img src="/images/682643_jump_for_joy.jpg" style="margin:5px 5px 5px 5px; border:1px solid black" align="right"/>Many Java-to-.Net ports are still unstable or several years behind their older cousins in features. But, I am very happy with NAnt, NUnit, NLog and NVelocity, they seem to have reached the point of production quality. Better VS integration would benefit NAnt and NUnit very much, and I&#8217;d like to say that Resharper is the solution for that, but it simply introduces too much problems as it is. I hope that it will get cleaned up soon.</p>
<p>Sharp-Develop is on a good way to become a serious competitor, especially if Microsoft keeps unit testing and code coverage as exclusive features of the most expensive Visual Studio version. I would like to see better customisation, less formatting bugs, more refactorings and CVS integration in Sharp-Develop. </p>
<p>Castle Project is very interesting – and I expect to see it gaining more and more support. Some parts of it need to get cleaned up, and it needs better documentation, but it is quite usable even now. </p>
<p>FitNesse is also a rising star of .Net space – it is a bit tricky to set up for .Net testing and lacks good .Net-oriented documentation, but once it&#8217;s running and you get a feeling what it can do, it works like magic. (I wrote a <a href="/fitnesse">short introduction to using FitNesse with .Net</a> which might help if you decide to use that tool.)</p>
<p>My conclusion is that it&#8217;s often necessary to dig deeper in order to get the right .Net tools – and not just use the port of a popular Java tool. On the end, here are two good places to start digging: <a "target="_blank" onClick="javascript:urchinTracker('/links/csharp');" href="http://csharp-source.net/">csharp-source.net</a> and <a "target="_blank" onClick="javascript:urchinTracker('/links/codeplex');" href="http://www.codeplex.com">www.codeplex.com</a>.</p>
<p>Image credits: <a "target="_blank" onClick="javascript:urchinTracker('/links/sxcvier');" href="http://www.sxc.hu/profile/vierdrie">Vierdrie/SXC</a>, <a "target="_blank" onClick="javascript:urchinTracker('/links/sxcjessics');" href="http://www.sxc.hu/profile/jessics">Jessics/SXC</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2007/01/21/enterprise-net-toolkit-unusual-suspects/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

