On Dec 31, 3:18 pm, Jeremy Chone <[email protected]> wrote:
> Hi Jim,
>
> Do you have a problem with non standard annotations or just with annotations
> in general? JSR 330 is standardizing DI annotations, so, soon they will be
> standard (and JSR330 are matching pretty well Google 
> Guicehttp://code.google.com/p/google-guice/wiki/JSR330

I have no problem with annotations in general.  Here are my concerns:
- don't want code to depend on guice; jsr would be better here, for
the @Inject; but this issue is minor compared to the others
- 3rd party code (or any code which I can't or shouldn't touch), can't
be annotated; I see there's ways around this with @Provider; seems a
bit verbose though.
- don't want interfaces coupled to implementations (referring to some
of the apparently optional annotations which I wouldn't use)
- don't want to comingle implementation with configuration; so, rather
have definition of wirings be in a Module, than as metadata
(annotations or whatever) directly in an implementation class

> As a user (i.e. App developer) I actually prefer annotations to XML for
> adding metadata to Java code. Annotations is usually much easier to maintain
> and less verbose than their XML counterpart.  Also, Google Guice allows you
> to override bindings and provides an easy to externalize name/value to
> property files.

Yeah, I don't want xml either.  :)  I want Java code, I just want a
clear separation of configuration.


> Even in the case of Hibernate I have moved to the Annotation way. The only
> drawback with annotations (especially with Hibernate EJB 3.0 annotations) is
> that I cannot have multiple (Object/Relational) bindings for the same
> objects, but 99% I just need only one.
>
> Anyway, these are just coding style, they both have their share of pros and
> cons. Regardless, if you come from Spring XML DI, Google Guice will
> definitely simplify your life and code.

I've used Spring in the past and definitely don't want to go the xml
route.  I hear they have Java-based configuration now, but I just want
a DI implementation which does just one thing:  DI.

thanks for the comments,
Jim

--

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