introduction to dependency injection using spring.net

Post on 16-Apr-2017

4.078 Views

Category:

Business

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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 rmontgomery@rpionline.com

•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

top related