The Spring.NET Framework

Reference Documentation

Rod Johnson

Mark Pollack

Rick Evans

Federico Spinazzi

Aleksandar Seovic

Rob Harrop

Griffin Caprio

Choy Rim

Version 1.1.0 Preview 2

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

November 16, 2005 - (Work in progress)


Table of Contents

1. Introduction
1.1. Overview
2. Background information
2.1. Inversion of Control
3. Objects, Object Factories, and Application Contexts
3.1. Introduction
3.2. The IObjectFactory and IObjectDefinition : The Basics
3.2.1. The IObjectFactory
3.2.2. The IObjectDefinition
3.2.3. The object type
3.2.3.1. Object creation via constructor invocation
3.2.3.2. Object creation via a static factory method
3.2.3.3. Object creation via an instance factory method
3.2.4. The object identifiers (id and name)
3.2.5. Singleton & Prototype Scope
3.3. Properties, collaborators, autowiring and dependency checking
3.3.1. Setting object properties and collaborators
3.3.2. Constructor Argument Resolution
3.3.2.1. Constructor Argument Type Matching
3.3.2.2. Constructor Argument Index
3.3.2.3. Constructor Arguments by Name
3.3.3. Object properties and constructor arguments in detail
3.3.3.1. Setting null values
3.3.3.2. Setting collection values
3.3.3.3. Inline objects
3.3.3.4. The idref element
3.3.3.5. Referring to collaborating objects
3.3.3.6. Value and ref shortcut forms
3.3.4. Setting a reference using the members of other objects and classes.
3.3.4.1. Setting a reference to the value of property.
3.3.4.2. Setting a reference to the value of field.
3.3.4.3. Setting a property or constructor argument to the return value of a method invocation.
3.3.5. Additional IFactoryObject implementations
3.3.5.1. Log4Net
3.3.6. Using depends-on
3.3.7. Autowiring collaborators
3.3.8. Checking for dependencies
3.4. Customizing the nature of an object
3.4.1. Lifecycle interfaces
3.4.1.1. IInitializingObject / init-method
3.4.1.2. IDisposable / destroy-method
3.4.2. Knowing who you are
3.4.2.1. IObjectFactoryAware
3.4.2.2. IObjectNameAware
3.4.3. IFactoryObject
3.5. Abstract and Child object definitions
3.6. Interacting with the IObjectFactory
3.6.1. Obtaining an IFactoryObject, not its product
3.7. Customizing objects with IObjectPostProcessors
3.8. Customizing object factories with ObjectFactoryPostProcessors
3.8.1. The PropertyPlaceholderConfigurer
3.8.1.1. Replacement with Environment Variables
3.8.2. The PropertyOverrideConfigurer
3.9. Registering additional custom TypeConverters
3.10. Using the alias element to add aliases for existing objects
3.11. The IResource abstraction
3.12. Introduction to the IApplicationContext
3.13. Configuration of IApplicationContext
3.13.1. Registering custom parsers
3.13.2. Creating cusotm resource handlers
3.13.3. Configuring Type Aliases
3.14. Added functionality of the IApplicationContext
3.14.1. Context Hierarchies
3.14.2. Using the IMessageSource
3.14.3. Using resources within Spring.NET
3.14.4. Loosely coupled events
3.14.5. Event notification from IApplicationContext
3.15. Customized behavior in the ApplicationContext
3.15.1. ApplicationContextAware marker interface
3.15.2. The IObjectPostProcessor
3.15.3. The IObjectFactoryPostProcessor
3.15.4. The PropertyPlaceholderConfigurer
3.16. Registering custom TypeConverter implementations
3.17. Importing Object Definitions from One File Into Another
3.18. Service Locator access
4. The IObjectWrapper and Type conversion
4.1. Introduction
4.2. Manipulating objects using the IObjectWrapper
4.2.1. Setting and getting basic and nested properties
4.2.2. Other features worth mentioning
4.3. Type conversion
4.3.1. Type Conversion for Enumerations
4.4. Built-in TypeConverters
5. Threading and Concurrency Support
5.1. Introduction
5.2. Synchronization Primitives
5.2.1. ISync
5.2.2. SyncHolder
5.2.3. Latch
5.2.4. Semaphore
6. Object Pooling
6.1. Introduction
6.2. Interfaces and Implementations
7. Object Navigation
7.1. Introduction
7.2. Simple Expressions
7.3. Navigating Collections
8. Aspect Oriented Programming with Spring.NET
8.1. Introduction
8.1.1. AOP concepts
8.1.2. Spring.NET AOP capabilities
8.1.3. AOP Proxies in Spring.NET
8.2. Pointcuts in Spring.NET
8.2.1. Concepts
8.2.2. Operations on pointcuts
8.2.3. Convenience pointcut implementations
8.2.3.1. Static pointcuts
8.2.3.2. Dynamic Pointcuts
8.2.4. Pointcut Superclasses
8.2.5. Custom Pointcuts
8.3. Advice types in Spring.NET
8.3.1. Advice Lifecycle
8.3.2. Advice types
8.3.2.1. Interception Around Advice
8.3.2.2. Before advice
8.3.2.3. Throws advice
8.3.2.4. After Returning advice
8.3.2.5. Introduction advice
8.4. Advisors in Spring.NET
8.5. Using the ProxyFactoryObject to create AOP proxies
8.5.1. Basics
8.5.2. ProxyFactoryObject Properties
8.5.3. Proxying Interfaces
8.5.4. Proxying Classes
8.6. Creating AOP Proxies Programmatically with the ProxyFactory
8.7. Manipulating Advised Objects
8.8. Using TargetSources
8.8.1. Hot swappable target sources
8.8.2. Pooling target sources
8.8.3. Prototype target sources
8.9. Defining new Advice types
8.10. Further reading and resources
9. .NET Remoting
9.1. Introduction
9.2. Publishing a Singleton SAO on the Server
9.3. Accessing a SAO on the Client
9.4. Remote Object Factory
9.5. Additional Resources
10. Spring Services
10.1. Introduction
10.2. Serviced Components
10.3. Server Side
10.4. Client Side
11. Windows Services using Spring.NET
11.1. Remarks
11.2. Introduction
11.3. The Spring.Services.WindowsService.Process.exe application
11.3.1. Installing
11.3.2. Configuration
11.4. Running an application context as a windows service
11.4.1. service.xml
11.4.1.1. Let the application know where it is
11.4.2. watcher.xml - optional
11.4.3. service.config - optional
11.4.4. bin directory - optional
11.5. Extending
11.5.1. The service-process-definition.xml file
12. Web framework
12.1. Introduction
12.2. Automatic context loading and hierarchical contexts
12.2.1. Configuration
12.2.2. Context Hierarchy
12.3. Dependency Injection for ASP.NET pages
12.3.1. Injecting Dependencies into Controls
12.4. Master Pages
12.4.1. Linking child pages to their master
12.5. Bidirectional data binding
12.5.1. Type Conversion
12.5.2. Data Binding Events
12.6. Localization
12.6.1. Automatic Localization Using Localizers ("Push" Localization)
12.6.2. Working with Localizers
12.6.3. Applying Resources Manually ("Pull" Localization)
12.6.4. Localizing Images within a Web Application
12.6.5. Global Resources
12.6.6. User Culture Management
12.6.6.1. DefaultWebCultureResolver
12.6.6.2. RequestCultureResolver
12.6.6.3. SessionCultureResolver
12.6.6.4. CookieCultureResolver
12.6.7. Changing Cultures
12.7. Result Mapping
12.8. Client-Side Scripting
12.8.1. Registering Scripts within the head HTML section
12.8.2. Adding CSS Definitions to the head Section
12.8.3. Well-Known Directories
12.9. Wizards
12.10. Web Services Support
12.10.1. Server-side issues
12.10.2. Client-side issues
12.10.3. Removing the need for .asmx files
12.10.4. Injecting dependencies into web services
12.10.5. Exposing PONOs as Web Services
12.10.6. Exporting an AOP Proxy as a Web Service
12.10.7. Client-side Proxy Creation
13. Spring.NET miscellanea
13.1. Introduction
13.2. PathMatcher
13.2.1. General rules
13.2.2. Matching filenames
13.2.3. Matching subdirectories
13.2.4. Case does matter, slashes don't
14. Visual Studio.NET Integration
14.1. XML Editing and Validation
14.2. Integrated API help
15. Quickstarts
15.1. Introduction
15.2. Movie Finder
15.2.1. Getting Started - Movie Finder
15.2.2. First Object Definition
15.2.3. Setter Injection
15.2.4. Constructor Injection
15.2.5. Summary
15.2.6. Logging
15.3. ApplicationContext and IMessageSource
15.3.1. Introduction
15.4. ApplicationContext and IEventRegistry
15.4.1. Introduction
15.5. Pooling example
15.5.1. Implementing Spring.Pool.IPoolableObjectFactory
15.5.2. Being smart using pooled objects
15.5.3. Using the executor to do a parallel grep
15.6. AOP
16. AOP Guide
16.1. Introduction
16.2. The basics
16.2.1. Applying advice
16.2.2. Using Pointcuts - the basics
16.3. Going deeper
16.3.1. Other types of Advice
16.3.1.1. Before advice
16.3.1.2. After advice
16.3.1.3. Throws advice
16.3.1.4. Introductions (mixins)
16.3.1.5. Layering advice
16.3.1.6. Configuring advice
16.3.2. Other types of Pointcut
16.3.2.1. Using Attributes As Pointcuts
16.3.3. AOP Miscellanea
16.3.3.1. Using Prototype Targets
16.4. A comprehensive example
17. .NET Remoting Quick start
17.1. Introduction
17.2. The Remoting Sample Project
17.3. Implementation
17.4. Running the application
17.5. Using the RemoteFactory
17.6. Additional Resources
18. SpringAir - Reference Application
18.1. Introduction
18.2. The Architecture
18.3. The Implementation
18.3.1. The Domain Layer
18.3.2. The Service Layer
18.3.3. The Web Layer
18.4. Summary
19. Spring.NET for Java Developers
19.1. Introduction
19.2. Beans to Objects
19.3. PropertyEditors to TypeConverters
19.4. ResourceBundle-ResourceManager
19.5. Exceptions
19.6. Application Configuration
19.7. AOP Framework
19.7.1. Cannot specify target name at the end of interceptorNames for ProxyFactoryObject
A. Spring.NET's spring-objects.xsd