commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Keyes <j...@mac.com>
Subject [CLI] Making Option Extensible
Date Wed, 24 Jul 2002 10:50:45 GMT
The current implementation of Option (and adding one to
Options) is very inflexible.  If another property is 
added to an Option then all of the constructors must
be changed and all of the addOption methods must be
changed.  

A user recently requested support for enum arguments,
i.e. if the argument is not present then use a default
value, otherwise it must be one from a specified list
of possible values.

I was thinking about how this would affect the current
implementation and I winced at all of the changes to the
constructors and the addOption methods.

I propose that we change from the approach of supporting
all of the properties in the constructor and the addOption
methods and instead only provide a set that initialise the
most frequently used properties i.e. String opt, 
String longOpt, boolean hasArg, String description. The 
other properties can be set using accessors if the user
so requires.

-John K


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


Mime
View raw message