The developer hands-on labs are a set of tutorials that introduce key features of the Web Client Software Factory. Each lab guides you step-by-step through the process of developing a complete Web client application using the Web Client Software Factory.
Prerequisites
To complete the labs, the following software must be installed on your computer:
· Microsoft Windows XP, Windows Server 2003, or Windows Vista operating system
· Microsoft .NET Framework 3.0 (required to use page flow; otherwise, .NET Framework 2.0 is satisfactory)
· Microsoft Visual Studio 2005 Team Edition for Software Testers (required to run unit tests in the first labs)
· Guidance Automation Extensions July 2007 CTP
· Enterprise Library 3.1 – May 2007
· Web Client Software Factory - June 2007
Note: The labs require that you install the Web Client Development guidance package. You can either use the software factory Windows Installer to install the guidance package or you can use Visual Studio to build and register the guidance package. For information about how to install the guidance package, see the Web Client Software Factory documentation.
Objectives
After completing the labs, you will understand how to use the software factory automation tools to create and update solutions and how to manually modify the code to perform typical development tasks. Specifically, you will learn how to perform the following tasks:
· Create a new Web client solution.
· Create a business module.
· Expose a business module to the Web site shell.
· Create a Composite Web Application Block service.
· Create a view with a presenter and unit tests.
· Use unit testing for pages with data bound controls.
· Define role-based access to a module’s features.
· Configure exception handling and logging.
· Define and execute a page flow.
Contents
Each lab contains a document with step-by-step procedures and a Visual Studio solution. The lab documents are located in the Developer/CS folder. The Visual Studio solution is located in the Solutions directory; this solution matches what you should create when you follow the step-by-step procedures to completion. To begin a lab, you can start with the solution that you developed in the previous lab or start with the end solution of the previous lab.
Note: The end solution of a lab is exactly the same as the start solution of the next lab. If you use the end solution provided in the hands-on lab package, you must enable the guidance package.
To enable the Web Client Development guidance package with the Guidance Package Manager
1. Using Visual Studio, open your solution.
2. On the Tools menu, click Guidance Package Manager.
3. In the Guidance Package Manager dialog box, click Enable / Disable Packages.
4. In the Enable and Disable Packages dialog box, select the Web Client Development check box.
5. Click OK.
This package includes the following hands-on labs:
· Lab 1: Creating an Initial Web Client Solution with Business Modules
· Lab 3: Adding Views and Unit Testing
· Lab 4: Data Binding with the View-Presenter Pattern
· Lab 5: Creating a Foundational Module
· Lab 7: Logging and Exception Handling
Getting Started
For labs 6 through 8, a SQL Server database is required. Web applications in these labs use the database to store ASP.NET membership information and data required by the Page Flow Application Block.
To create the database, you can run a script that creates the database for you. The script requires SQL Server 2005 or SQL Server 2005 Express Edition.
To create the database with SQL Server 2005 Express Edition
· In the Scripts folder, execute the script named SetupDatabase.bat.
To create the database with SQL Server 2005:
· In the Scripts folder, open a command prompt, and then run the following command:
SetupDatabase.bat .
Note: The parameter (.) specifies the SQL Server instance. In this example, the script creates the database on the local SQL Server instance.
The script creates a database named WCSF_HOLs.
Background: Web Client Software Factory
Architects and developers can use the Web Client Software Factory to quickly incorporate many of the proven practices and patterns of building Web client applications. These practices and patterns have been identified during the development of many Web client applications and their components.
These applications have one or more of the following characteristics:
· They have complex page flows and workflows.
· They are developed by multiple collaborating development teams.
· They are composite applications that present information from multiple sources through an integrated user interface.
· They support XCopy deployment of independently developed modules.
· They support online business transaction processing Web sites.
The software factory contains a collection of reusable components and libraries, Visual Studio 2005 solution templates, wizards and extensions, How-to topics, automated tests, extensive architecture documentation, patterns, QuickStarts, and a reference implementation. The software factory uses ASP.NET, the Windows Workflow Foundation, and the Enterprise Library–May 2007.
By using the software factory, architects and developers can focus their efforts on business opportunities and create Web client applications that effectively address the needs of their organizations. Figure 1 illustrates the scope of the Web Client Software Factory.
Figure 1
Web Client Software Factory scope
Using the Web Client Software Factory
You can use the Web Client Software Factory to create and extend Web client applications. It contains both manual instructions and automated guidance for implementing useful patterns of Web client applications. Figure 2 illustrates the common developer activities supported by the software factory.
Figure 2
Common Web Client Software Factory development activities