Far Away Developer

Sebastien Lachance

Archive for November, 2007

Setting up a Subversion server (using svnserve)

Posted by Sebastien Lachance on November 29, 2007

(Index of the whole series)

I got hold of an old computer that I will be able to use as a continuous integration server and Subversion repository. This weekend, I got some free time and decided to set-up Subversion on it. I was surprised on how much it was easy. The documentation is all but superfluous and it was very instructive. So here is how you can do it.

Downloading and installing subversion

You can find the latest version here. I used the svn-1.4.5-setup.exe one. Just install it like any other program, there is no additional things to modify in the setup.

Setting up a repository

You may want to create a repository right now to make sure that you can make some test later. I recommend using TortoiseSVN for that, unless you want to learn all the command to use Subversion (not so hard to do). To do that, you simply need to create a folder that you want as a repository (this folder will hold all your files and every change made to them), and right click on it. Select the TortoiseSVN\Create repository here menu items and select the Native File System (FSFS) radio button. You now have fully working repository. For a comparison of Native File System versus Berkeley Database, take a look at this link.

createrepository

svnserve

You then have two choices to use Subversion remotely. First one is to use the Apache HTTP server and the second one is to use svnserve. I have decided to use svnserve because it’s a lightweight server program and I don’t need encryption and logging. Also svnserve is a lot faster and it’s the best options for small teams. You may want to make sure you are able to access it. Open a command prompt and type svnserve. You should see the following :

svnserve-commandprompt

If you still planning to use svnserve right now, you have two choices : install it as a service or open it each time you want to access a repository.

If you are planning to open it each time you want to access your repository, launch a command prompt and type svnserve -d. You have access to all the repositories you may have created on the server.

If, however, you decide to use it as a Windows Service (it will reopen automatically each time you start the server), Use this at a command prompt :

C:\> sc create svn binpath= “\”C:\program files\svn\bin\svnserve.exe\” –service -r C:\nameofyourrepository” displayname= “Subversion Server” depend= Tcpip start= auto

Controlling access

If you attempted to use this right now to make a check-in, you will find that you don’t have Write access. This can be changed by editing the svnserve.conf found in your repository folder. You need to find the # anon-access = read and change it to anon-access = write (don’t forget to remove #). This will grant write access to all anonymous users. This is not the ideal, but in a single programmer scenario it works perfectly. However, note that if you need a more robust authentication solution, it’s totally possible. I will not cover it right now, but the full procedure is described in the TortoiseSVN documentation (Section 3.2.4).

svnservedotconf

 

Accessing the repository remotely

Open the repository browser (shown below) and type svn://nameofyourserver/nameofyourrepository. Can it be more easy?

access

Posted in Agile, Project, Tools | No Comments »

Building a new application - Introduction

Posted by Sebastien Lachance on November 27, 2007

(Index of the whole series)

I want to build an application and release it to the community. This is an application I had in mind for a long time. Basically, it’s a logging application. Not the one you would use to track requirements and time spent on a project. I’m talking about a logging application to log your weight, track your goals, what you’ve eat, do reports , etc. I know it’s something people want. I’m not doing it for money. I want to learn as much as possible and I think that writing code and solving new problems is a great way to learn. I have to take some basic decision at the beginning of the project and I must admit it will be a good excuse to make a list of all the new things (for me) that I want to use in the project and blog about them. This is an opportunity for me to take the time of using object-oriented techniques and becoming more agile. I will also blog a lot about that, because I find that blogging an interesting tool to learn and explaining to others help reinforce knowledge and being more confident. Also, posting about your goals, makes it a little harder to abandon too early.

My requirements are the the following :

  • Test-Driven development. I want a coverage of 95% at least.
  • Building an continuous integration server.
  • Applying at the best of my knowledge Object-Oriented principle.
  • User stories.
  • Identify mistakes as soon as possible and learn from them.
  • Use a source control software and learn some of the best practices of source control management.

Technologies I want to use :

So I want It to be Agile as most as possible. First step, print the Agile Manifesto!

Posted in .NET, Agile, Programming, Tools | No Comments »

Setting up CruiseControl.Net screencast

Posted by Sebastien Lachance on November 15, 2007

I am a long time reader of the CodeBetter.com blogs and usually read all their posts. But last year, I missed one that I consider a gem. If you ever struggled with building a continuous integration with CruiseControl.Net, you will find that screencast very instructive. Excellent job Jean-Paul S. Boodhoo’s!!

Automating Your Builds With NAnt - Part 8 (Enter CruiseControl)

Posted in Continuous Integration | No Comments »

Reality of type sharing in WCF

Posted by Sebastien Lachance on November 13, 2007

I am working a lot right now with WCF (Windows Communication Foundation). I am doing the service side of the architecture. The problem we faced this week was with type sharing. Suppose you have a customer class and an address class as data contract. The customer have an address list. Then we have two services who use those types, CustomerService and AddressService. One of the service do operation with the customer and the second on the address. All this one one assembly. On a real world scenario we had to take the address of the customer we just got with the customer’s service and provide it to the address’s services.

We used Visual Studio to generate the proxies for those services. Since CustomerService and AddressService are each one aware of the 2 data contracts (Address and Customer) the call made to svcutil from Visual Studio does not generate proxies with type sharing. You have yourself two times the address class and then can’t be passed from one service to another.

But fortunately, a solution exist!

1. I had to separate the data contracts from the services contracts and puts them in a new assembly.

2. Do not ever use Visual Studio to add service reference (this is what will get you 2 times the same class in 2 different namespaces ).

3. Learn to use svcutil. Then learn about the /r: switch. When using this switch, you can specify which assembly to use when resolving reference.

The 2 downside I see, is that you can’t use Visual Studio anymore to generate proxies and that you need to control both side (service and client). Or at least the service side and provide the data contracts assembly to your client.

Posted in .NET, WCF | 1 Comment »

Becoming a better developer : Where am I? Third update

Posted by Sebastien Lachance on November 12, 2007

Things are finally getting smoothly. I have been really busy with the construction of the new house and haven’t been able to get up to speed with my goals. I am a the second book of 12, and the challenge end in two months. There is some good news at least, I am now able to concentrate fully on my objectives. But I have reduced the number of books to 4…

This is the new list :

I am also on the way of regaining my health back. At least 15 minutes a day of workout.

And finally, for the small project, I am working really hard on this. I am planning something real soon.

Posted in Fun, Learning, Programming | No Comments »