Spring Preliminary Study Summary
There are four aspects to the general summary: IOC,AOP,JDBC, and transaction management
IOC: Implements a reversal of the power of the new class. (The new class usually causes code redundancy, and the manual new class does not meet the requirements of the dynamic new class.)
AOP: Make it easy to add code (without having to add a source document, add it directly to the slice class, change the configuration document)
JdbcTemplate: Database operation is more simple
Transaction management: The methods of the same transaction are either executed successfully or not. (Save money to someone else affairs management to solve their own money is less than the money is not much of this situation occurs)
1.IOC (combination of annotations and XML (JUnit test))
Write a UserService this class
Test class:
XML configuration file:
2.AOP (Key AspectJ)
Write a class of Userdao
Slice class:
Test class:
XML configuration file:
3.jdbctemplate (annotations (configuring C3P0 connection pooling))
Write class User
Class Userdao:
Write a jdbc.properties database connection file:
To write a configuration file:
To write a test class:
4. Transaction management (annotations)
Writing the Accountdao class
Accountdaoimpl class:
Writing the Accountservice class
Accountserviceimpl class:
JDBC Database Connection File
XML configuration file:
Test class:
Spring Beginners Summarize ideas