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/11/02 23:30:58 UTC

[CLI] defaults WIP

I've committed some classes for the defaults support 
(Props/Prefs/XML/...).
See the cli2.defaults package for the public API and the 
cli2.defaults.impl
contains the impls for Properties and Preferences support.  None of this
is integrated yet so the test cases are very simple at the moment.

-John K


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


Re: [CLI] defaults WIP

Posted by Rob Oxspring <ro...@imapmail.org>.
Hmm, well I've finished off the tests and committed my CommandLine changes
in the direction of flexible defaults.

I'm pretty sure there's room for manoeuvre between the two approaches.
Using CommandLines already allows hasOption(..), getSwitch(..), and
getValues(..) to delegate to the default values, and the fact that the
default is a CommandLine means that multiple levels of defaults can be
chained together.  On the other hand using the interface approach feels a
lot cleaner and could be useful to tidy up the api of the current
CommandLine.

Is the factory approach really helping us though? I'm not really seeing an
advantage of the factory approach:

        Defaults defaults =
            DefaultsFactory.createDefaults(
                "org.apache.commons.cli2.defaults.impl.PreferencesImpl",
                prefs);

Over the would-be direct approach:

        Defaults defaults = new PreferencesImpl(prefs);

Anyway, enough for now

Rob

(P.s. my SourceDestArgument and CpTest are now committed too)

----- Original Message ----- 
From: "John Keyes" <jb...@mac.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Sunday, November 02, 2003 10:30 PM
Subject: [CLI] defaults WIP


> I've committed some classes for the defaults support
> (Props/Prefs/XML/...).
> See the cli2.defaults package for the public API and the
> cli2.defaults.impl
> contains the impls for Properties and Preferences support.  None of this
> is integrated yet so the test cases are very simple at the moment.
>
> -John K
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>


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