Spring and TDD
Spring and TDD
Spring Framework
By: Mike Shoemaker
What is Spring?
POJO’s
Role of the Container
AKA BeanFactory
Default configuration
Efficient
ClassPathXMLApplicationContext
FileSystemXMLApplicationContext
XmlWebApplicationContext
“Hollywood Principal”
Avalon
Constructor Based
Pico Container
Setter Based
Spring
Example of Constructor
Based Injection
<bean id="dataSource" class="javax.sql.DataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/myDS</value>
</property>
<property name="username"><value>fred</value></property>
<property name="password"><value>password</value></property>
</bean>
// Instantiate
LoginDAO dao = new LoginDAOJDBC();
http://www.springframework.org
Spring Live
Spring In Action
Pro Spring
Group Exercise