The benefits of spring's business management

Source: Internet
Author: User
Tags aop

In previous JdbcTemplate, the transaction was submitted successfully, and exception handling was done through Try/catch, and in spring. The spring container integrates transactiontemplate, encapsulating all of the transactional functions, including transaction rollback at the time of the exception, and complex business functions such as data submission when the operation succeeds. This is managed by the spring container, greatly reducing the amount of code for the programmer, and also has good administrative control over the transaction. Hibernate also has the management of transactions, hibernate in the transaction management is through the Sessionfactory creation and maintenance session to complete. Spring also integrates the Sessionfactory configuration without having to set the sessionafactory through Hibernate.cfg.xml.
This will make good use of sping for transaction management. It avoids the need to get the session instance to start the transaction/COMMIT/ROLLBACK TRANSACTION and the tedious Try/catch operation for each data operation. These are good applications for the AOP (aspect-oriented programming) mechanism in spring. On the one hand, the development of business logic clearer, professional division of labor more easily. On the other hand, the application of SPIRNG AOP isolation reduces the coupling of the program so that we can combine the various facets in different applications to greatly improve the code reuse degree.

The benefits of spring's business management

Related Article

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.