The Artima Developer Community
Sponsored Link

Java Community News
A Look at Resource Injection through Annotations

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

A Look at Resource Injection through Annotations Posted: Jun 15, 2006 8:15 AM
Reply to this message Reply
Summary
Resource injection through annotations is one of the main ease-of-use features in Java EE 5. Ryan Lubke's recent Sun Developer Network article summarizes what parts of Java EE 5 can be configured through annotation-based resource injection, and provides guidelines for the use of such annotations.
Advertisement

Among Java EE 5's usability improvements is the extensive use of annotations as a means to specifying resource dependencies of an enterprise component. While XML-based configurations are still supported, annotations are now the preferred means of declaring dependencies. Indeed, the question of when to use annotations and when to prefer XML-based configuration was a subject of Artima's recent interview with EJB 3 chief architect Linda DeMichiel, Refactoring the EJB APIs: A Conversation with Linda DeMichiel, Part I.

In his recent Sun Developer Network article, Web Tier to Go With Java EE 5: A Look at Resource Injection, Ryan Lubke provides a nice summary of EE 5 annotations. For contrast, he first shows how dependency was specified before annotations were introduced, and then presents an example of the dramatic code reduction when declaring that same dependency with an annotation. The article includes a table of a complete reference to EE 5 annotations as well.

There is no question that annotations are a simplifying mechanism for resource injection. By the same token, however, annotations can be used to streamline and factor out other repetitive tasks as well. What other roles do you see annotations play in your projects? Do you create custom annotations to simplify common coding tasks in your own apps?

Topic: A Look at Resource Injection through Annotations Previous Topic   Next Topic Topic: jGuard Web Authentication Framework Releases 0.8 Version

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use