Spring learning point

Source: Internet
Author: User

1. Customize the task. 2. active MQ. 3. Email. 4. configuration. 5. Integration

 

Spring includes IOC and AOP

 

IOC

IOC is the inversion of control (DI dependency injection). IOC can improve reusability and refactoring. In applicationContext. xml, each bean is a singleton.

If you do not want to use a Singleton, you can add the scope = "prototype" attribute to the bean.

Method of dependency injection:

1. setter method injection adds property to bean

2. constructor-arg ref = ""/>

3. Interface Injection

Add default-autowire = "byName" to the xml template configuration. If an object exists in a bean, you do not need to reconfigure it.

The bean class must have an attribute. The attribute name must be the same as the bean id of the object in xml.

 

AOP

Aop is a plane-oriented programming that improves code refactoring and reduces coupling.

Notification is divided

Pre-notification
Post notification
Surround notification
Exception notification
Advisor notification

After the target object is woven into the target object, a proxy object with the same interface as the target object is returned. If no interface exists, CGLIB is used as the proxy by default.

CGLIB proxy

 

 

Transactions

ACID: atomicity, consistency, isolation, durability

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.