There’s a new kid around the block! The bbv.Common library contains now a generic bootstrapper implementation. The bootstrapper provides a simple and flexible way to make your application’s startup and shutdown behavior pluggable and extendable. As usual the bootstrapper package comes along with high unit test coverage (it has been developed with TDD), executable specifications (MSPECified 😉 ) and a sample application. The bootstrapper is focused around the following core features…
- The bootstrapper provides a single entry point to startup and shutdown the application.
- Fluent definition syntax allowing to expressively define the startup and shutdown behavior of the application.
- Pluggable behaviors which allow to extend the bootstrapping mechanism in AOP like style.
- ConfigurationSection support with behavior.
- Unobtrusive Key/Value pair configuration section support with behavior.
- Thorough reporting of application startup and shutdown behavior.
When building a new application the bootstrapper is essentially the only root object which needs to be instantiated in your application main method. The bootstrapper is the central point of your application’s startup and shutdown behavior.
Extensions contain methods which are called upon startup and shutdown of the bootstrapper. The methods of the extensions are extension points which can consume information gathered during the bootstrapping process for example configuration. Extensions are added directly on the bootstrapper.
An extension resolver allows to plug in extensions into the bootstrapper. All extensions which are resolved by the extension resolver are added after manually added extensions.
Behaviors allow extending the bootstrapping process in an aspect oriented style. Behaviors gain access to extensions which are participating in the bootstrapper process and can therefore influence them for example by injecting additional runtime information into an extension.
The strategy defines the order of execution for extension points and behaviors. The strategy is also the context provider for context information which needs to be passed to the extension points. The strategy allows to hooking in custom executors and reporting context.
Executors are responsible for executing extension points on extensions and the behaviors attached to it. Different executors can be used for the startup and shutdown phase of the application.
The bootstrapper package ships with some core behaviors which can be plugged into your bootstrapping mechanism. Core behaviors include
- Support to automatically load configuration sections
- Support for bootstrapper configuration sections which are basically key/value pairs and their values get automatically propagated to properties of extensions
- Support to automatically dispose extensions which implement IDisposable
The bootstrapper records the bootstrapping process and allows reporting the whole process to a reporter. This can be used to automatically generate architecture and design documents which describe the bootstrapping mechanism.
You can grab the latest bits at teamcity.codebetter.com or build it yourself by cloning the bbv.common repository on github under github.com/bbvcommon. Currently there hasen’t been an official release and I’m still working on the documentation. But I’ll keep you updated on the topic!