We've got three options for exposing provider methods.
@Provides @Exposed A provideA() {...}
@Provides(exposed=true) B provideB() {...}
protected void configure() {
expose(C.class);
}
...
@Provides C provideC() {...}
Option A is what we're using today. This is mostly 'cause @Exposed was
developed as an extension to Guice (and therefore adding a parameter
to @Provides was not possible).
Option B is tempting, and more in the spirit of annotations. It's also
a tiny bit safer, since now we're assured we'll never encounter an
@Exposed without a corresponding @Provides.
Option C is simplest, but it hurts the annotate-like-mad convenience
of @Provides methods. It also separates the expose call from the
@Provides method.
Anyone feel strongly about how users should expose @Provides methods?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice-dev" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---