Java ee6 standard CDI tutorial Part 1

Source: Internet
Author: User

1. Introduction
This tutorial describes DI and covers the characteristics of CDI, such as class-based security injection, configuration resetting, replacement, and selection.
CDI is a Java Standard Specification for DI and AOP. DI and AOP have a high degree of knowledge. Java needs to process DI and AOP to construct its standards. DI and AOP are the basis of many Java frameworks.
CDI is the basis of JavaEE 6. It quickly achieved support from the guest OS Resin, IBMs WebSphere, Les Glassfish, Red Hats JBoss, and multiple application server. CDI is very similar to Spring and Guice frame frames, just like JPA is like ORM. CDI simplifies the APIs for DI and AOP. If you have used Spring or Guice, you will find that CDI is easier to learn and use. If you are new to DI, then CDI will allow you to quickly understand DI. CDI is easier to learn and use.
CDI can be used independently or embedded in any application.
It is not surprising that this course came out after three years of Spring 2.5 DI teaching (using Spring "new" DI injection. It will be interesting to understand Spring DI injection than it was written three years ago.
2. Objectives and objectives of this tutorial
The tutorial aims to describe and describe the DI and CDI of EJB3.1 and JSF that do not include complex content.
The advantage of CDI is that it can be beyond EJB and JSF. This tutorial only focuses on CDI. Again, it is said that JSF2 and EJB3.1 are not available in this tutorial. Many articles and tutorials cover how to use CDI (JEE6 rules ). This tutorial is not. It is only CDI.
This tutorial provides an example of code generation. You can use it as an example.
We will start from the Foundation step by step. Once you have understood the basic principle, we will be able to make quick moves.
All the sample code can be run properly. We will not press the temporary code. If the Code cannot be run, it will not belong to this tutorial.
The Demo code has a clear question, so you can make a food order by reading the course, if you want to use some of the features of cdi di, you can search for examples in the menu.
The accessories, expansion, interception, and fan Wai are not in the fan Wai of this tutorial.
If this tutorial has received sufficient feedback and comments through the google Discussion Team, I will add CDI AOP (accessories and interceptors) the comprehensive teaching process has also been expanded.
More suggestions and feedback will help me do better.
3. Reinjection
The dependency injection (DI) process is provided for the expansion of software components. DI can make your code proxy architecture simple and clean.
It helps you to use the test drive to activate the square design interface, and provides a unified method for injection to Yi Lai. For example, a data access object (DAO) can be connected by a data database.
Instead, use JNDI to query the data database and connect it. You do not need to note it.
Considering that the JNDI is a thorough lookup, the DI frame takes the generation object to find its quasi-standby object (dependent ), a di server can inject these dependent images. This is regarded as "haoleawu's original rule". "If you do not need to call me (check the object), I will call you (add the object )".
If you touch the CRC card, you can think of a relay as a composite. One operator is an object, and the other object requires R

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.