You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Hendrik Maryns <qw...@sneakemail.com> on 2008/10/14 16:25:35 UTC

Re: [CLI] Trouble with generifying Commons CLI §2: what are the values?

Emmanuel Bourg schreef:
> Hendrik Maryns a écrit :
> 
>> Here, one problem is the getValue() method and its relatives.  It is not
>> possible to derive from the context which type of value it is supposed
>> to return.  The method getValue() itself returns an object, but all
>> usage examples I have seen until now return Strings and even more, there
>> are even classes where it *can* be deduced that it will always return a
>> String.  So my question is: why doesn’t getValue() return a String, and
>> should getValues() return a List<String> or a List<Object>?  I think the
>> latter would be unfortunate.
> 
> I guess the intent is to return more than a simple String, for example a
> File, a Number or an URL. So the only solution is to return a List of
> Objects.

I think you’re right, and I regret it.  This is an indication the API
should be altered such that this kind of type information does not occur.

Are there CLI developers here that want to discuss the issue?

H.
-- 
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


Re: [CLI] Trouble with generifying Commons CLI §2: what are the values?

Posted by Rahul Akolkar <ra...@gmail.com>.
On Tue, Oct 14, 2008 at 10:25 AM, Hendrik Maryns
<qw...@sneakemail.com> wrote:
> Emmanuel Bourg schreef:
>> Hendrik Maryns a écrit :
>>
>>> Here, one problem is the getValue() method and its relatives.  It is not
>>> possible to derive from the context which type of value it is supposed
>>> to return.  The method getValue() itself returns an object, but all
>>> usage examples I have seen until now return Strings and even more, there
>>> are even classes where it *can* be deduced that it will always return a
>>> String.  So my question is: why doesn't getValue() return a String, and
>>> should getValues() return a List<String> or a List<Object>?  I think the
>>> latter would be unfortunate.
>>
>> I guess the intent is to return more than a simple String, for example a
>> File, a Number or an URL. So the only solution is to return a List of
>> Objects.
>
> I think you're right, and I regret it.  This is an indication the API
> should be altered such that this kind of type information does not occur.
>
> Are there CLI developers here that want to discuss the issue?
>
<snip/>

In theory, all CLI developers are here, so post your thoughts and
discussions may ensue, based on developer interest.

-Rahul


> H.
> --
> Hendrik Maryns
> http://tcl.sfs.uni-tuebingen.de/~hendrik/
> ==================
> Ask smart questions, get good answers:
> http://www.catb.org/~esr/faqs/smart-questions.html
>
>

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