Hi,

In short, which argument helper library you use does not have much to
do with Guice. Guice will mostly help you in structuring your
application, and end up with (hopefully) something testable, reusable
and decoupled.

For those values pass through as program arguments, since they are
available at startup and will not change, you can use them to pick the
correct Guice Modules and/or pass the values on to them. The modules
can then bind them as constants or further do some logic on them.

For configuration files, take a look at:
http://groups.google.com/group/google-guice/browse_thread/thread/e685b642dba235ff

For interactively entered values, you could do something like the
following: Startup Guice with the program arguments. Have Guice start
a service that is aware of all the different mechanisms that can be
invoked / configured and this service than deals with all the input
and reacts accordingly.


I've used both commons-configuration and commons-cli, they did what
they were meant to do, and kept out of the way. I haven't seen args4j
before, but since Kohsuke is responsible for it, I suspect that it's
very good.


regards,
Guðmundur Bjarni



On Dec 16, 9:14 pm, Pierre8r <[email protected]> wrote:
> Hello,
>
> I am a newbie.
>
> What API to choose to address the following problems.
> Java program CLI ( command line interface) and parameters.
>
> Is Guice always the way to choose ?
>
> Case A:
> Few parameters (about 3).
> Like directory, and so on.
>
> Case A bis:
> Same parameters, but you can enter an interactive way different types
> of commands with their parameters.
>
> Case B:
> Many parameters, including instances of the same object with several
> parameters.
> Considering how much these parameters are, they are in a file (XML or
> properties).
>
> Case B bis:
> Same parameters, but you can enter an interactive way different types
> of commands with their parameters.
>
> What about following APIs?
>
> Commons Configurationhttp://commons.apache.org/configuration/
>
> CLIhttp://jakarta.apache.org/commons/cli/
>
> args4j
> https: / / args4j.dev.java.net /
>
> Guicehttp://code.google.com/p/google-guice/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to