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" <[EMAIL PROTECTED]>
To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to