Spring in Action Study Note 2-DI, spring-di

Source: Internet
Author: User

Spring in Action Study Note 2-DI, spring-di

Assemble bean

October 9, 2015

9: 49

In Sprng, objects do not need to be searched for or created by themselves. Related: the container is responsible for assigning objects to each object by referencing the objects that need to cooperate with each other.

The act of creating a cooperative relationship between application objects is generally called an assembly ). This is the essence of dependency injection.

Declare bean

Typical xml configuration file

Capture Time of on-screen editing:

Spring core comes with 10 command Spaces

Screen clip capture time:

Capture Time of on-screen editing:

Screen clip capture time:

Constructor injection:

Screen clip capture time:

Screen clip capture time:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Initialization and destruction

Screen clip capture time:

Screen clip capture time:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Injection attributes

1. Inject simple values:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

2. Introduce other beans

Screen clip capture time:

Introduce internal bean

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Command Space p Assembly attributes

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

3. Assembly set

Capture Time of on-screen editing:

Screen clip capture time:

Screen clip capture time:

Screen clip capture time:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Maap

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Null Value:

Capture Time of on-screen editing:

Assemble with expressions (omitted ).

Minimal xml configuration

October 9, 2015

11: 10

4. Automatic Assembly of types (omitted)

Capture Time of on-screen editing:

3.2 annotation assembly:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

Capture Time of on-screen editing:

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.