Spring CodeConfig - Reference Documentation


Stephen Bohlen , Mark Pollack


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.

I. Introduction
1. Introducing CodeConfig
1.1. A Dependency Injection Example
1.2. Migration to CodeConfig
1.2.1. The CodeConfig Classes Creating the CodeConfig Classes Elements of the CodeConfig Classes
1.2.2. Creating and Initializing the Application Context
1.3. More Granular Control Using CodeConfig
1.4. Organizing and Composing Multiple [Configuration] Classes
1.4.1. Multiple Stand-Alone Configuration Classes
1.4.2. High-Level [Configuration] Classes that [Import] Others
1.4.3. Referencing [Definition]s from one [Configuration] Class in Another
II. Reference
2. CodeConfigApplicationContext Reference
2.1. Concepts
2.1.1. Using the CodeConfigApplicationContext
2.1.2. Mixing and matching configuration metadata formats
2.2. Scanning Basics
2.2.1. Scaning all assemblies
2.2.2. Scanning specific assemblies and types
2.2.3. Assembly Inclusion Constraints
2.2.4. Type Inclusion Constraints
2.3. Advanced Scanning Behavior
2.3.1. Combining Root Path, Assembly Constraints, and Type Constraints
2.3.2. Using your own AssemblyObjectDefintionScanner Instance Scanning Specific Assemblies and Types
3. Attribute Reference
3.1. [Configuration] Attribute
3.1.1. Using the Configuration Attribute Simple Usage Controlling the Name of the Configuration Class
3.2. [Definition] Attribute
3.2.1. Using the Definition Attribute Simple Usage Controlling the Name and Aliases of the Defined Object Setting an Init Method for the Object Setting a Destroy Method for the Object
3.3. [DependsOn] Attribute
3.3.1. Using the DependsOn Attribute Controlling Creation Dependencies
3.4. [Import] Attribute
3.4.1. Using the Import Attribute Specifying Additional Types to Scan Chaining [Import] Directives
3.5. [ImportResource] Attribute
3.5.1. Using the ImportResourceAttribute Specifying an IResource Specifying Multiple IResources Specifying a specific IObjectDefintionReader to Parse the IResource
3.6. [Lazy] Attribute
3.6.1. Using the Lazy Attribute Specifying Lazy Instantiation Specifying Non-Lazy (eager) Instantiation
3.7. [Scope] Attribute
3.7.1. Scope Attribute Usage
4. Sample Applications
4.1. Overview
4.2. Spring.IoCQuickStart.MovieFinder
4.2.1. Modifying App.config
4.2.2. Replacing Appcontext.xml with CodeConfigBootstrap.xml
4.2.3. Introducing the MovieFinderConfiguration CodeConfig class
4.3. Spring.MvcQuickStart
4.3.1. Modifying Web.config
4.3.2. Replacing controllers.xml with CodeConfigBootstrap.xml
4.3.3. Introducing the ControllerConfiguration CodeConfig class
4.4. Spring.CodeConfig.Migration