How to: Create a Web Client Solution | How to: Create a Business Module | How to: Use and Register Services | How to: Add Module Pages to the Site Map | How to: Map Types for Dependency Injection | How to: Authorize Web Pages

How to: Create a Foundational Module

Foundational modules are units of development and deployment that encapsulate infrastructure services. They do not contain Web pages nor do they have a module composition container. An example of a foundational module could be a module that contains services, such as logging and authorization services.
This topic describes how to create a foundational module using the Add Foundational Module recipe of the Composite Web Client Automation.

Note:
The Composite Web Client Automation is not included in this bundle. For information about the Composite Web Client Automation, including download information, see Composite Web Client Automation on CodePlex.

Prerequisites

The Add Foundational Module recipe assumes that you have an existing Web client solution created with the Composite Web Automation. For information about how to create a Web client solution, see How to: Create a Web Client Solution.
The Add Foundational Module recipe applies to the Visual Studio solution folder (typically, this is the Modules solution folder).

Steps

The following procedure describes how to use the recipe to create a foundational module.

To use the Add Functional Module recipe to create a foundational module
  • In Solution Explorer, right-click a solution folder, point to Web Client Factory, and then click Add Foundational Module (C#) or Add Foundational Module (Visual Basic), as shown in Figure 1.
AddFoundationalModuleRecipeMenu.PNG
Figure 1
The Add Foundational Module recipe menu
  • (Optional) In the Add New Project dialog box, illustrated in Figure 2, change the name of the project in the Name box and the location of the project in the Location box.
AddFoundationalModuleProjectTemplate.PNG
Figure 2
The Add Foundational Module project template
  • Click OK. The recipe starts the Add Foundational Module Wizard. Figure 3 illustrates the first page of the wizard.
AddFoundationalModuleRecipeWizard.PNG
Figure 3
The Add Foundational Module recipe wizard
  • Under Web site, select the Web site with a Web.config file that is to be used to define the module.
  • (Optional) If you want a test project for the module to be created with test classes for your module components, select the Create project for unit tests check box.
  • (Optional) If you want to see a summary of the recipe actions and suggested next steps after the recipe completes, select the Show documentation after recipe completes check box.
  • Click Finish. The recipe generates the foundational module.

Outcome

As illustrated in Figure 4, you will have the following elements in your solution:
  • A C# class library project. This is the module class library. It contains a module initialization class and an empty folder named Services.
  • (Optional) A test project for the module. This is an empty project that you can use to create your unit tests.
  • An updated Web.config file. The module definition will be added to the <modules> section of the Web.config file of the selected Web site. The Composite Web Application Block uses this information to load the module when the application starts.
WebClientSolution.PNG
Figure 4
Web Client Solution with a foundational module Module1

Next Steps

After you run the Add Foundational Module recipe, you are ready to perform one of the following steps:
  • Implement services. Services are components that provide application or infrastructure logic.
  • Registers the services as global services. To register global services, you add them to the root composition container. For more information related to registering and using services, see How to: Use and Register Services.
How to: Create a Web Client Solution | How to: Create a Business Module | How to: Use and Register Services | How to: Add Module Pages to the Site Map | How to: Map Types for Dependency Injection | How to: Authorize Web Pages

Last edited Jan 17, 2008 at 2:50 PM by siacomuzzi, version 3

Comments

No comments yet.