Monday, March 04, 2013

UnityBootstrapper–Order in which methods are called

The MSDN documentation page “Initializing Prism Applications” shows the basic stages of the bootstrapping process, but it leaves out when some of the methods that can be overriden get called.

Process as defined in MSDN:



Here is the order in which all methods that can be overridden are called:

  1. Run (called typically when app is starting up)
  2. CreateLogger
  3. CreateModuleCatalog
  4. ConfigureModuleCatalog
  5. CreateContainer
  6. ConfigureContainer
  7. ConfigureServiceLocator
  8. ConfigureRegionAdapterMappings
  9. ConfigureDefaultRegionBehaviors
  10. RegisterFrameworkExceptionTypes
  11. Create Shell
  12. InitializeShell
  13. InitializeModules

And here is logging output of the Prism bootstrapper process (where UnityLoggerFacade is a logging class that I created):

UnityLoggerFacade              - Logger was created successfully.
UnityLoggerFacade              - Creating module catalog.
UnityLoggerFacade              - Configuring module catalog.
UnityLoggerFacade              - Creating Unity container.
UnityLoggerFacade              - Configuring the Unity container.
UnityLoggerFacade              - Adding UnityBootstrapperExtension to container.
UnityLoggerFacade              - Configuring ServiceLocator singleton.
UnityLoggerFacade              - Configuring region adapters.
UnityLoggerFacade              - Configuring default region behaviors.
UnityLoggerFacade              - Registering Framework Exception Types.
UnityLoggerFacade              - Creating the shell.
UnityLoggerFacade              - Setting the RegionManager.
UnityLoggerFacade              - Updating Regions.
UnityLoggerFacade              - Initializing the shell.
UnityLoggerFacade              - Initializing modules.
UnityLoggerFacade              - Bootstrapper sequence completed.

No comments: