I sometimes see the term "Bootstrapper". I saw it last when creating some learning exercises for Prism. I stumbled upon UnityBootstrapper
class. My question is: when would you call a class a "Bootstrapper"? Why? What does it say about the class?
-
3Check out the Wikipedia article– ChrisF ♦Jul 27, 2011 at 15:37
-
english.stackexchange.com/questions/35129/…– JobJul 27, 2011 at 15:52
4 Answers
In your specific example you're talking about a Dependency Injection Container Bootstrapper. This is where you configure all of your instances and generally prepare the container for use.
It also ends up being where most of the coupling in your application resides (it has to reside somewhere), but this is a side effect, not the purpose.
In more general terms, a bootstrapper is just a class or method which prepares/configures a group of classes/objects or an entire API for your specific needs and use.
In the general sense, there is an excellent answer over at EL&U.SE to the question What's the meaning of “bootstrap”?:
Bootstrap refers to a process that is akin to picking oneself up by the bootstraps. The idea is that it is physically impossible to lift yourself by bending over and trying to "lift".
Bootstrapping refers to doing exactly that but in a way analogous to physics. Computing is the most common area I hear the term. A program that bootstraps itself is one that begins with an extremely trivial operation and then uses that to continue the startup process internally. In a strict sense, the program does need help for the very first step but once that happens it doesn't need any external help.
As such, the UnityBootstrapper
would logically be a class that allows your application to pick itself up by it's bootstraps, an assertion confirmed by the MSDN page for the class.
Base class that provides a basic bootstrapping sequence that registers most of the Composite Application Library assets in a IUnityContainer.
Remarks: This class must be overriden to provide application specific configuration.
In low level terminology, a bootstrapper is a piece of code loaded on bootup which configures memory and the environment before triggering the operating system's entry point.
Usually it means something which, given a minimal set of data, builds a complete object. For example a YieldCurveBootstrapper takes market quotes (deposit rates, swap rates, etc.) and builds a calibrated yield curve.