Re: Options module

37 views
Skip to first unread message

Christopher Currie

unread,
Apr 20, 2011, 1:06:05 PM4/20/11
to google...@googlegroups.com, google-s...@googlegroups.com, config...@googlegroups.com
[cross-posting to config-magic]

There's some overlap between this project and config-magic, a very
nice library that doesn't have a guice dependency and supports some
fine tuning of how arguments are specified.

https://github.com/brianm/config-magic

It doesn't, however, have a guice module extension to bind the
configuration classes, though I have seen a not-yet-open-sourced
version that is very good. It'd be great if the two projects could
collaborate!

Christopher

On Wed, Apr 20, 2011 at 12:39 AM, Dhanji R. Prasanna <dha...@gmail.com> wrote:
> [cross-posted to guice/sitebricks]
> Hi All,
> A basic version of the options module is now in place. Options enable you to
> specify application-specific parameters at runtime, say via command line, to
> configure your app in a natural, type safe fashion:
> @Options
> public interface MyConfig {
>   String domain();
>   int port();
> }
> and on the command line:
> java MyApp --domain=google.com --port=80
>
> The MyConfig interface can then be injected *anywhere* in your App so long
> as you install the OptionsModule. Here's an example:
> https://github.com/dhanji/sitebricks/blob/master/sitebricks-options/src/test/java/com/google/sitebricks/options/OptionsTest.java
> Note that this does not require sitebricks to work (it works in any vanilla
> Guice app), and will ship as part of Sitebricks 0.8.6. It even supports
> namespaces to disambiguate different @Options interfaces. We also support
> (multiple) resource bundles and properties files as means of configuring
> (not just the command line).
> Maven dep (if you build locally):
>     <dependency>
>       <groupId>com.google.sitebricks</groupId>
>       <artifactId>sitebricks-options</artifactId>
>       <version>0.8.5-SNAPSHOT</version>
>     </dependency>
> Or give us a week until 0.8.6!
> Dhanji.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To post to this group, send email to google...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-guice...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>

Reply all
Reply to author
Forward
0 new messages