I might be pointing out the obvious, but you can also do programmatically everything you can do using .NET configuration -- register custom configuration parsers, type aliases, type converters, etc.
1. To register configuration parser, use one of the XmlParserRegistry.RegisterParser() overloads;
2. For type aliases, use one of TypeRegistry.RegisterType() overloads;
3. For custom type converters, use one of TypeConverterRegistry.RegisterConverter() methods
4. For custom resource implementations use one of ResourceHandlerRegistry.RegisterResourceHandler() methods.
That's effectively what various configuration section handlers do for you, but in some cases it makes a lot more sense to do it directly, by making appropriate API calls. This is especially true when you need to load the context into separate and somewhat "exotic" environments, such as COM+ container, as it eliminates dependency on .NET configuration files.
Bootstraping context directly using XmlApplicationContext constructor also makes perfect sense in such an environment, but you need to make sure all custom parsers are registered before you try to load the context. Custom config parsers that are built into Spring.Core will be automatically registered, but you will have to register parsers that exist within other assemblies, such as Spring.Data or Spring.Services, manually.
HTH,
Aleks
|