In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the example analysis of JSR through JavaEE 6 dependency injection. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Google Guice and SpringSource, which has just been acquired by VMware, have announced that they will work together to propose a standard set of annotations for dependency injection, namely JSR-330. But these comments are not consistent with JSR-299, which has sparked a lot of debate, but now everything has been settled.
Many people have expressed their views on the conflict between JSR-299 and JSR-330, as follows:
◆ Gavin King: I think introducing another set of semantically identical annotations is a complete mistake, and the problem it is trying to solve is more or less the same.
Bob Lee: while 299 is suitable for small Java EE applications, its global configuration and indirect nature make it difficult to adapt to millions of lines of code, as developed by Google. We can easily support 299 style annotations on Guice, but we can't achieve all the functions of Guice through 299, so there is no reason to give up Guice and switch to 299. Personally, I think you've made a lot of innovations on 299, but you don't fully understand the fact that user code needs to be maintained.
◆ Alex Miller: moving into JSR 299 is a dangerous sign.
◆ Antonio Goncalves: I hope we don't start a new battle, like between Java Module (JSR 277) and Modularity Support (JSR 294).
◆ Rickard ö berg makes an objection: instead of using annotations like @ Inject in general, we choose to use annotations that represent the scope of the target object, because everything means nothing.
JSR-330 has passed the vote of the JSR review, but many voters have emphasized the harmony of the two norms:
◆ Sun: we hope that this JSR will work with JSR-299 to reach a consistent and comprehensive dependency injection standard for the SE and EE platforms. This standard must be developed prior to the release of the public preview version of the JSR.
◆ Red Hat: recognizing that the draft is supported by the community, we intend to make a final comment when the expert group publishes the public draft. If some agreement can be reached between the JSR and JSR-299 (which defines a lightweight model for dependency injection), we will not hesitate to vote yes. Red Hat promises to make a modest contribution to this consistency.
◆ Ericsson: we support efforts to standardize dependency injection for Java SE, but more importantly, it is important for both Java SE and EE to maintain consistency with JSR 299.
◆ IBM: we also believe that such a dependency injection specification for SE applications is necessary, but the proposed injection pattern is different from the definition in the EE platform. The injection model of SE/EE must form a separate and extensible programming model: define a set of core functions for SE and extend it through the capabilities of EE. Therefore, if it is not unified, IBM will not support JSR 299 or 330.
◆ Oracle: while supporting the JSR, Oracle is seriously concerned about the integrity of the draft and its differences with JSR 299, which could lead to fragmentation of the platform. Therefore, we expect to reach an agreement with JSR 299 before the release of the public preview version of the JSR. We believe that a revision or maintenance version of JSR 250 would be more suitable for publishing comments related to dependency injection. In the end, we hope that this consistent effort will keep the dependency injection of the SE and EE platforms consistent, forming a standardized mechanism to meet various needs.
At present, the conflict between these specifications has been resolved. JSR-330 (dependency injection for Java) and JSR-299 (context and dependency injection for the Java EE platform) have been agreed, and the latter will take the annotation of the former, both of which will be part of Java EE6.
What is dependency injection?
Dependency injection is to make the dependencies between types configurable, that is, to determine the dependencies between types by means such as configuration files at run time. When dependency injection is not used, the relationship between types is hard-coded in the program.
This is the end of the sample analysis of JSR through JavaEE 6 dependency injection. I hope the above can be helpful and learn more. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.