views:

74

answers:

2

I'm working on an application which uses a bootscrapper object to perform some operations when the application first starts. e.g. registers IoC objects, puts certain variables into the asp.net Application session object, does some security checks etc.

I had a look around the internet and couldn't find a reference to a bootscrapper pattern, or any article about the subject.

Is this a known pattern under a different name?

Edit: The object is run whenever an application is started. e.g. I've seen it in a wcf service, and an ASP.net application.

+3  A: 

In the context of installers the role of a bootstrapper is to prepare the host machine for the installation. Typically, a bootstrapper would handle the following tasks:

  • unpack the actual installer
  • install any pre-requisites (e.g. make sure the correct version of Windows Installer is installed, installation of .NET Framework etc)
  • install additional patches

These actions won't be undone if you decide to uninstall your application at a later point in time. Therefore you probably wouldn't want to use the bootstrapper mechanism to configure your application (e.g. configure your ASP.NET application, modify security settings etc). Such configuration steps are better taken care of using custom actions from within your installer.

0xA3
+1  A: 

Bootstrapper or bootscrapper? Never heard of the latter.

Bootstrap as a concept is widely used.

In your case there is some initialisation work you want to do. That exact work must surely be defined by you, I would not expect too see any reusable defintion of that.

One key idea here is that you may need to be sure that all of your initialisation is complete before public requests are serviced. I would expect the specific of how that's achieved to be specific to the framework you are working in. Often there are initalisation callbacks where you can out your code and the framework guarantees not to enable your object till those callbacks return.

So, maybe you could search for Initialisation and/or callbacks.

djna