.NET Client Conversion
clebert.suconic Feb 2, 2009 4:33 PMAs the other developers know, I'm doing the .NET conversion for the Client library.
To get things started I created my environment on both Windows and Linux.
For LInux, I installed an IDE called monodevelop. (Both Ubuntu and Fedora will have it on the respective package Managers). MonoDeveloper will be able to open the same project files managed by Visual Studio.
For Windows, I'm using KVM. (KVM is faily simple. The only real difficulty is to enable virtualization on the computer BIOS :-) )
On Windows, besides Visual Studio, I have installed NUnit for Testcases and http://ankhsvn.open.collab.net/ for SVN integration on Visual Studio.
C# and Java are very similar. There are few common changes I already identified though:
- Capital Convention on name methods.
Java will aways use lowerCase as the first letter, while C# Capital on the first letter for methods.
- Properties Get and Set Methods
C# introduces a new syntax for property get and propert set. Instead of regular methods, .NET programs will have a special syntax for properties:
public int Length { get; set; }
On the code above, the get and set implementation is done automatically. You could also add code if you need extra behaviour.
I don' t have an opinion about this yet. Maybe I should keep property methods as methods during the conversion, so it would be easier to keep code similarity between Java and C#. I will make my opinion about this as I go, and I will keep you guys posted.
- On the testcases, I'll use a super class for everybody to make the conversion easier. In C# you call Assert.areEquals instead of assertEquals methods. I''m adding those definitions on a super class to make life easier on the conversion.
I"m still going through the conversion. From now on it should be faster.
I want to keep feeding this thread with more findings, and write a WIKI & blog about my findings when I have more information.
Also, please... share you experience on this thread if you have any experience about converting Java classes as C#,