commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell" <>
Subject Re: I've ported CLI to C#, next steps?
Date Fri, 25 Apr 2008 17:29:24 GMT
On Thu, Apr 24, 2008 at 10:48 AM, Schley Andrew Kutz
<> wrote:
>  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.

All sounds great :)

>  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,

Using AL 2.0 will probably be easier - otherwise you'll be part AL 2.0
and part BSD. If you use AL 2.0, then you just need to add your
copyright bits to the NOTICE file already there. [I'm assuming a port
is a derivative work etc, no real idea].

>  Thoughts?

Sounds good. Once the site is up and running, let us know and we can
link from the CLI website as well as any wiki pages that might be good
for "You like Commons? Check out...." links.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message