Both of the code links were 404s, so no idea what your code looked like. 
 So, what are you trying to do?

There's nothing wrong with the builder pattern even if you're using Guice. 
 If the parameters don't change for the life of the application, but you're 
writing something extensible, you might just have users pass a 
URLTransformerBuilder to your Module's constructor, and then build and bind 
the result.

Either way, classes that want a URLTranformer and are created by Guice 
probably just include it in constructor arguments in a constructor 
annotated with @Inject.

If it's supposed to be configured from properties that are part of 
application configuration, you'll need to get them into the application 
somehow (properties files, etc.), perhaps using a library that does that 
such as (shameless plug) https://github.com/timboudreau/giulius

Generally, if the arguments are bad and the object is configured on 
startup, you probably just want to throw an Exception or Error early enough 
in startup to bail out of the JVM entirely - failing early is a Good 
Thing[tm].  If it's at runtime, there's nothing special you'd do 
particularly differently, just be aware that your exception might be 
wrappered in one of Guice's if it is thrown during object creation.

-Tim

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to