You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by John Keyes <jb...@mac.com> on 2003/02/07 00:25:13 UTC

[CLI] char versus String for option name?

I have done some more work on the class diagram
( http://www.integralsource.com/cli/datatype2.gif ).  As you can see by
supporting the choice of 'char' and 'String' as the Option name the
design is much more complex.  Wouldn't it be much better to drop
support for 'char'?  This would simplify the design by reducing the
number of classes:
  . No need for Posix/GnuOption just OptionImpl
  . No need for Posix/GnuArgument just ArgumentImpl
  . reduced number of methods on CommandLine (API not finalized)
  . reduced number of methods on the builder (not specified yet but
    should be very similar to the current approach).

Do people think that dropping support for 'char' would cause much
pain for people?  If a migration script is provided that will update
code that uses the char to use String would that make the pain
acceptable?

Cheers,
-John K
- - - - - - - - - - - - - - - - - - - - - - -
Jakarta Commons CLI
http://jakarta.apache.org/commons/cli


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


Re: [CLI] char versus String for option name?

Posted by John Keyes <jb...@mac.com>.
I've updated the class diagram again.  This is a 'char as Option name' 
free
zone ;)  This results in a much cleaner API and a much nicer class
hierarchy.  I would be in favour of this approach.  It would of course
involve the user having to change the code.

I am going to implement an XML->Java code generator so that when API
changes occur (I know they shouldn't but I think the current approach is
hard to understand) the Options can be recreated by running the 
generator.
This will not address changes to CommandLine but that should be defined
as final if this change goes ahead.

Anyhoo, check out the new class diagram at:
http://www.integralsource.com/cli/datatype3.gif
and let me know if there are any comments.

-John K

On Thursday, Feb 6, 2003, at 23:25 Europe/Dublin, John Keyes wrote:

> I have done some more work on the class diagram
> ( http://www.integralsource.com/cli/datatype2.gif ).  As you can see by
> supporting the choice of 'char' and 'String' as the Option name the
> design is much more complex.  Wouldn't it be much better to drop
> support for 'char'?  This would simplify the design by reducing the
> number of classes:
>  . No need for Posix/GnuOption just OptionImpl
>  . No need for Posix/GnuArgument just ArgumentImpl
>  . reduced number of methods on CommandLine (API not finalized)
>  . reduced number of methods on the builder (not specified yet but
>    should be very similar to the current approach).
>
> Do people think that dropping support for 'char' would cause much
> pain for people?  If a migration script is provided that will update
> code that uses the char to use String would that make the pain
> acceptable?
>
> Cheers,
> -John K
> - - - - - - - - - - - - - - - - - - - - - - -
> Jakarta Commons CLI
> http://jakarta.apache.org/commons/cli
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
- - - - - - - - - - - - - - - - - - - - - - -
Jakarta Commons CLI
http://jakarta.apache.org/commons/cli


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