Java EE 6 Dependency Injection finally came to an agreement __java

Source: Internet
Author: User
Tags java se
Java EE 6 Dependency Injection finally agreed.

Author Geoffrey Wiseman translator Zhang Long released on August 23, 2009 10:13 A.M.

Earlier this year, Google Guice and SpringSource announced that they would collaborate to propose a standard set of annotations for dependency injection, the JSR-330. But the annotations were inconsistent with JSR-299, and then sparked a lot of controversy, but now everything is settled: JSR-299 uses JSR-330 annotations, both of which will be part of Java EE 6.

A number of people on the JSR-299 and JSR-330 conflict about their own views, listed as follows: Gavin King: I think the introduction of another set of semantically and 299 the same annotation is a complete mistake, and its attempt to solve the problem is similar to 299. Bob Lee: While 299 is a good fit for small Java EE applications, its global configuration and its indirect nature make it difficult to adapt to the millions of-line application, as Google has developed. We can easily support the 299-style annotation on the guice, but cannot achieve the full functionality of Guice through 299, so there is no reason to give up guice and turn to 299. Personally, I think you've made a lot of innovations in 299, but you don't fully understand the fact that user code is needed to be maintained. Alex Miller: Marching into JSR 299 is a dangerous sign. Antonio Goncalves: I hope we don't have a new campaign, like between Java Module (JSR 277) and modularity Support (JSR 294). Rickardöberg the opposition: instead of using annotations such as the general use of @inject, we chose to use annotations that represent the scope of the target object, because everything also means nothing.

JSR-330 has passed the JSR review vote, but many voters have highlighted the two standard of harmony: Sun: We hope that the JSR will work with JSR-299 to achieve a consistent and comprehensive dependency injection standard for SE and EE platforms. This standard must precede the public preview version of the JSR before it is released. Red Hat: We recognize that the draft is supported by the Community and therefore intend to make a final comment when the group publishes its public draft. If there is a certain consistency between the JSR and the JSR-299 (which defines a lightweight model for dependency injection), then we will not hesitate to vote for the vote. Red hat promises to make a modest contribution to this consistency. Ericsson: We support the effort to standardize the dependency injection of Java SE, but we'd like to emphasize that maintaining the consistency with JSR 299 is important for both Java SE and EE. IBM: We also believe that such a dependency injection specification for SE applications is necessary, but the proposed injection pattern is not the same as the EE platform definition. The Se/ee injection model must form a separate, extensible programming Model: Define a core set of functions for SE and extend it through the EE functionality. Therefore, if not unified, IBM will not support JSR 299 or 330. Oracle: While supporting the JSR, Oracle is gravely concerned about the integrity of the draft and its disagreement with JSR 299, which could lead to fragmentation of the platform. Therefore, we expect to agree with JSR 299 before the JSR's public preview is released. We believe that one revision or maintenance version of JSR 250 would be more appropriate for issuing annotations related to dependency injection. Ultimately, we hope that this consistency effort will keep the dependency injection of SE and EE platforms consistent, creating a standardized mechanism to meet a variety of requirements.

The current conflict between these norms has been resolved. JSR-330 (Java-oriented dependency injection) and JSR-299 (context and Dependency injection for Java EE platforms) have been agreed, and the latter will take the former annotation, both of which will become part of the Java EE6. So far, the community's response has been positive (Matt Corey, Jeremy Norris, Alex Miller, Oliver Gierki, Niklas Gustavsson).

View English Original: Dependency injection harmonized for Java EE 6

Turn from: http://www.infoq.com/cn/news/2009/08/dependency-injection-javaee6

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.