spring four days
on the first day: spring and spring framework outlined in the IOC configuration xml coveted
second day: spring-based annotation IOC and ioc Case
Day: The spring aop configuration xml and AOP and based
on the fourth day: Spring in the spring jdbcTemplate and transaction control
spring Overview
What is the spring
spring advantage of
convenient decoupling, simplify development. IOC container
AOP programming support
declarative transaction support
to facilitate testing procedures
to facilitate integration of various frameworks
Coupling procedure
dependencies between program
dependencies between classes
dependencies between methods
Decoupling
reduce the dependencies between program
the actual development, should do compile does not rely, rely only run
The idea of decoupling
the first step: using reflection to create objects, and avoid the use of the new keyword
Step two: create objects to get the fully qualified name of the class by reading a configuration file
is not equal to the entity classes javabean
javabean much larger than the entity class
javabean java language is written reusable components
It is the creation of our service and dao objects
The first requires a service profile configuration and our dao
content = configured to uniquely identify fully qualified class name
second, by reading the contents of the configuration file in the configuration, the object to create reflected
Profiles can be xml, may also be properties
Singleton object, from start to finish only one instance of the object is created only once, so that class members will only be initialized once.
Many cases of objects being created many times, the efficiency is not high singleton object