Spring CodeConfig - Reference Documentation

Authors

Stephen Bohlen , Mark Pollack

1.0.1

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.


Preface
I. Introduction
1. Introducing CodeConfig
1.1. A Dependency Injection Example
1.2. Migration to CodeConfig
1.2.1. The CodeConfig Classes
1.2.1.1. Creating the CodeConfig Classes
1.2.1.2. 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
2.3.2.1. Scanning Specific Assemblies and Types
3. Attribute Reference
3.1. [Configuration] Attribute
3.1.1. Using the Configuration Attribute
3.1.1.1. Simple Usage
3.1.1.2. Controlling the Name of the Configuration Class
3.2. [Definition] Attribute
3.2.1. Using the Definition Attribute
3.2.1.1. Simple Usage
3.2.1.2. Controlling the Name and Aliases of the Defined Object
3.2.1.3. Setting an Init Method for the Object
3.2.1.4. Setting a Destroy Method for the Object
3.3. [DependsOn] Attribute
3.3.1. Using the DependsOn Attribute
3.3.1.1. Controlling Creation Dependencies
3.4. [Import] Attribute
3.4.1. Using the Import Attribute
3.4.1.1. Specifying Additional Types to Scan
3.4.1.2. Chaining [Import] Directives
3.5. [ImportResource] Attribute
3.5.1. Using the ImportResourceAttribute
3.5.1.1. Specifying an IResource
3.5.1.2. Specifying Multiple IResources
3.5.1.3. Specifying a specific IObjectDefintionReader to Parse the IResource
3.6. [Lazy] Attribute
3.6.1. Using the Lazy Attribute
3.6.1.1. Specifying Lazy Instantiation
3.6.1.2. 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