Jarrod,

What is the meaning of doing this? *Inversion of Control* is about making
your objects more cohesive as possible, loose coupled and modular. But with
logging there is no benefits, once because you'll create the logger object
as an static variable and this is responsability of the class and not of the
object itself.

What you can do in this sense and Guice will help you either is write some
crosscut concern code with interceptors, you create an annotation, annotate
your method / class and then creates a bind in your Guice module that
activate an interceptor for every class / method annotated with your created
annotation.

Because what I've understood about your "doubt" isn't that you don't know
how to use the features in Guice and yes where you can use, what benefits it
will bring and how can you use them. Right?

This link <http://code.google.com/p/google-guice/wiki/AOP> will help you, I
guess. Just for information, moving the responsabilities of creating objects
for you and even binding the correct implementation of some interface is
about *Inversion of Control* while sharing some behavior among some layers
of your code is about *Aspect Oriented Programming*.

Hope it helps you! :)

Atenciosamente,

*Jayr Motta*
Software Developer
*
*
I'm  on 
BlackBeltFactory.com<http://www.blackbeltfactory.com/ui#!User/jmotta/ref=jmotta>
!



On Mon, May 9, 2011 at 6:20 PM, Jarrod Roberson
<[email protected]>wrote:

> I am trying to evaluate Guice as our standard for doing what it does best.
>
> But I am having a hard time accepting some of the trade offs?
>
> I like the auto-magically assigning with @Inject private static Logger
> logger;
>
> But I don't want to sacrifice the ability to make that "final" as well.
>
> Is there some magical incantation to allow me to specify injects on private
> static final variables?
>
> --
> 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.
>

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