Guice is meant to sit on the sidelines. Unless there's a good reason to mock
out the specific utility for testing, I wouldn't bother injecting. In your
example, Objects is used internally within Guice itself.
Google's public apis covers a lot of ground =)

Some projects have a hard dependency on Guice, some do not. Typically
libraries do not force you into depending on Guice, hence, Google
Collections is standalone. However for complete apps or reference
implementations it makes more sense to depend on Guice, hence Apache Shindig
and Google Wave RI "expose" Guice.

Dhanji.

On Sun, Aug 16, 2009 at 2:59 AM, Gili <[email protected]> wrote:

>
> I noticed that the com.google.common.base.Objects utility class
> consists of two static method. Should one ever use Guice to inject
> utility classes? Is there a reason this wasn't done in this case?
>
> In fact, I believe this is related to a previous discussion we had
> about exposing Guice in public APIs. Is Google Collections an example
> of avoiding the use of Guice in public APIs? Do any of Google's public
> APIs expose Guice? Or do they keep it hidden in the hood?
>
> Thanks,
> Gili
> >
>

--~--~---------~--~----~------------~-------~--~----~
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