commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schley Andrew Kutz <ak...@lostcreations.com>
Subject I've ported CLI to C#, next steps?
Date Thu, 24 Apr 2008 17:48:43 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi. I've ported version 1.1 of the CLI library to Microsoft .NET 2.0  
using C#. My reasons are not selfless -- I simply needed a good  
command line argument parsing library for .NET, and I could not find  
one. Instead of reinventing the wheel I decided to port your library  
since I use it whenever developing command line applications in Java.

Here are the notable changes I made while porting:

- - Java's iterator is bi-directional while .NET's enumerator is simple,  
and uni-directional. I created a class, BidirectionalEnumerator<T> to  
match the functionality present in Java.

- - Getters and setters have become property accessors. For example,  
instead of getWidth() and setWidth(), there is now Width { get; set; }.

- - Method names now begin with upper case.

- - Class level variables are now prefixed with "m_".

- - Interfaces now begin with upper case "I". Ex. CommandLineParser is  
now ICommandLineParser.

- - I've used generics where possible instead of Objects. Ex. An  
ArrayList of Object types intended to hold strings is now List<string>.

- - I've used Dictionary<Tk,Tv> for a hash table.

- - In Java, the method substring is defined as func(int begin, int end)  
where end is exclusive and the length to splice is a result of end -  
begin. In .NET Substring is func(int begin, int length) where length  
is inclusive. Instead of changing your math I instead created a static  
class called JavaPorts and have created the method  
JavaPorts.Substring( string value, int beginIndex, int endIndex ) that  
functions as Java's substring.

I generally release my code under the New BSD license, and unless you  
would like to host this port on Apache's site I am going to open a  
SourceForge project for my port, or simply host it on my own site, http://www.lostcreations.com

.

Thoughts?

(p.s. Thanks for the great library!)

- --
- -a

"condensing fact from the vapor of nuance"

gpg pubkey:         http://www.lostcreations.com/~akutz/akutz.gpg
lostcreations ca:  http://www.lostcreations.com/lostcreations.com-ca.crt

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFIEMf7Tg8lceyAqqQRAjy2AKDN7AjPh+4Z7oSITW8IwII7NcwUsQCgwbga
8CbTPbgRnyRTikh+9K0Ua1c=
=gLZf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message