Establishing an Environment for Multiple Developers
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
Several of the requirements for creating a multiple developer environment for Commerce Server 2007 are common to any multiple developer software project. These requirements include the following:
You should select and use a source control system, such as Microsoft Team Foundation Server (TFS) or Microsoft Visual Source Safe. These systems use check out and check in procedures to prevent developers from accidentally overwriting each other's work. A source control system also enables developers to synchronize their snapshot of the source code with the code of their peers.
You should designate one of your computers as an integration or build computer (referred to as the build computer in the rest of this topic) on which the work of multiple developers is frequently brought together and tested. This process helps determine incompatible development sooner instead of later.
The developers on your team should have their own development computers that provide isolated environments in which they can develop their own code according to their own programming style. When a developer has a new feature or modification that works sufficiently well, the developer checks it into the source control system. Other developers are then free to synchronize with it and continue their own development.
The remaining requirements for creating a multiple developer environment for Commerce Server are specific to Commerce Server. These requirements include the following:
Each development computer and the build computer should run Windows Server 2003 or Windows Server 2008. Each development and/or build computer should also have Commerce Server 2007, SQL Server 2000 or 2005, and Visual Studio 2005 or Visual Studio 2008 installed.
Note
In a development environment, you can use Windows Vista or Windows XP as your operating system. See the Commerce Server 2007 Installation and Configuration Guide for more information.
To test your secure URLs, you should download the Internet Information Services (IIS) Resource Kit and use SelfSSL.
Perhaps the biggest decision that you must make for your multiple developer Commerce Server project is whether your developers will work with local copies of the various Commerce Server databases, or whether they will work in an environment in which they share single instances of those databases.
Local Databases versus Shared Databases
At the start of your project, you must decide whether developers will have local copies of the Commerce Server databases on their individual development computers, or if they will work with shared instances of these databases. The following table lists the pros and cons to each approach.
Local Databases |
Shared Databases |
---|---|
Each development computer and the build computer have their own copy of the Commerce Server databases that includes the Administration database (MSCS_Admin).
Note:
It is still possible to share the Profiles database because it is a global resource.
Pros:
Cons:
|
All the development computers (and possibly the build computer) share a single copy the Commerce Server databases that includes the Administration database (MSCS_Admin). Pros:
Cons:
|
The following drawing illustrates the environment for multiple developers when you use local databases.
The following drawing illustrates the environment for multiple developers when you use shared databases.
Additional Tips and Best Practices
The following are several tips and best practices to help create a successful multiple developer environment for Commerce Server development:
If you select the shared database approach, you should not use the Add Web Server option in the Commerce Server Manager or the Site Packager. If you use this option, you will create a Web farm and developers will be unable to predict which Web server will service a given request. This makes debugging very difficult. Instead, use Commerce Server Manager to set the Nonsecure host name and the Secure host name for the application your developers are jointly developing to "localhost". This will enable the developers to run and debug the code on their own development computers and share the data in the various Commerce Server databases.
On one of your computers, create a basic version of your Commerce Server site that includes its resources and corresponding Visual Studio project (if you select the shared database approach, follow these steps on the computer upon which the shared databases will reside, regardless of whether the computer is one of the development computers or the build computer). Use Authorization Manager to modify the authorization policies for the Commerce Server Web services, as appropriate for your environment. When these initial steps are complete, check your site code and Visual Studio project files into the source control system. Also, use the Commerce Server Site Packager to create a site package for your basic site and its resources.
After you copy the site package to the remaining computers, use Commerce Server Site Packager to unpack your basic site as appropriate for the local versus shared database approach that you have chosen. Be careful when you specify the database connection strings on the Site Packager wizard screens, as this determines the approach you are taking.
Development can then start by using standard source controlled processes. The process should start by synchronizing the development computers together with the source control system to make sure that all the development computers are starting from the same point.
Important Note: To avoid problems with paths, relative references, and so on, make sure that you unpack the site by using the same directory and Web site that you used when you first created the site.
Avoid developing on your build computer. You want the build computer to remain a pristine reflection of the source files that have been checked into the source control system. You might want to designate a member of your team to be in charge of builds. This person should protect the state of the build computer so that it remains in a well-known state.
The more frequently you build and test on the build computer, the closer you will stay to having a working Commerce Server Web site.
To avoid issues during deployment, run the various services and application pools under the same accounts, and with the same permissions, as will be used in your production environment. If this creates too much of a burden in your situation, you can perform this secure deployment testing on the build computer. However, it might cost you more to resolve secure deployment issues in the build environment than you would save by having the developers resolve the issues in their isolated environments.
If you have chosen the local databases approach, make sure that the developers understand the processes for sharing changes with each other. Schema changes must be exported and checked in with the code that depends on those changes. In addition, other developers must retrieve and apply the schema changes to their database(s) together with synchronizing the dependent code.