Upload
ryan-montgomery
View
4.081
Download
3
Embed Size (px)
Citation preview
Introduction to Dependency Injection using Spring.NETRyan Montgomery
So why Spring.NET?1. We use more than IoC.2. Well documented.3. Large community.4. A proven framework.5. Supported.
Spring.Core1. IoC is the heart of spring.2. Additional Features
1. Expression Language2. Validation Framework3. Data binding Framework4. Dynamic Reflection5. Threading6. Resource abstraction
What is Inversion of Control?•Hollywood Principle.
▫“Don't call us, we'll call you.”•Dependency Injection•Service Locator
What is Dependency Injection?•“Dependency injection is a style of object
configuration in which an objects fields and collaborators are set by an external entity. In other words objects are configured by an external entity. Dependency injection is an alternative to having the object configure itself.”▫Jenkov Aps
DAO Refactor 0
DAO Refactor 0
DAO Refactor 1
DAO Refactor 2
Biz Component
Biz Component
Spring IoC Container1. Responsible for the
Instantiation and Injection of dependencies based on configuration.
2. The IObjectFactory is the actual representation of the Spring IoC container.
3. The most commonly used IObjectFactory implementation is the XmlObjectFactory class.
Demo
This demonstration is based on the Movie Finder example in Spring.NET.
Contact Information•Ryan Montgomery
▫Blog http://rmontgomery429.blogspot.com
▫Email [email protected]
•Rapidparts Inc.▫Site
http://www.rpionline.com▫Blog
http://blogs.rpionline.com
References• Spring.NET Framework
▫Chapter 5. The IoC container http://www.springframework.net/doc-latest/
reference/html/objects.html• Martin Fowler
▫Inversion of Control Containers and the Dependency Injection pattern http://martinfowler.com/articles/injection.html
• Jenkov▫What is Dependency Injection
http://tutorials.jenkov.com/dependency-injection/index.html
Parking Lot