Team Development Using Silverlight

In this lesson of the Silverlight tutorial, you will learn...
  1. About source control / version control
  2. About the source control products offered by Microsoft
  3. To manage source code by using Visual SourceSafe

This lesson will discuss source control options in a Microsoft development environment.

Source Control Overview

Developing an application is a huge task and normally involves multiple developers and designers. The multiple developers and designers that are involved will, undoubtedly, need to work on the same files that other developers and designers are working on or have worked on. Over the life of a development project, this scenario presents a concurrency issue.

A concurrency issue occurs whenever a shared resource may be modified by multiple users when the modifications made conflict with each other. The classic example of a concurrency conflict scenario occurs in a database environment where a single row of data may be modified by multiple users. For example, if a user begins updating the address of a customer and, while the modification is being made, another user modifies and updates the same customer address, should the modification made by the first user overwrite the modification made by the second user? In a scenario such as this, custom code is almost always required to resolve the conflict.

The same scenario comes into play when multiple developers and designers are working concurrently on the same application files. For example, if one developer modifies the code in a class file and a second developer also modifies the same code in the same class file, should the modification made by the second developers simply overwrite the modification made by the first developer? Should both modifications be logged in a modification history log? Should an attempt be made to merge the modifications made by both developers?

The common solution to resolving conflicts somewhat in the application development environment is to incorporate another piece of software that manages updates to source code for application components. This type of software is called source code control software or, just simply, source control. Source control software may also be referred to as version control software.

Microsoft Source Control Products

Source control software functions by converting source code files into text and then, upon each source code file being updated, logging an updated version of the file in a data repository. In order for source control software to function correctly, source code files must be able to be converted to text. Almost all source code files created using current Microsoft development technologies (the .NET Framework, SQL Server 2005, etc) can easily be converted to text and incorporated into a source control application.

There are several source control applications available on the market. Microsoft offers two source control applications: Visual SourceSafe and Team Foundation Server.

Visual SourceSafe

Visual SourceSafe (VSS) has been around for many years and is capable of managing source code for most Microsoft development products. VSS is currently in version 2005. VSS is designed for small teams and is even handy for single developers. Visual SourceSafe maintains each version of a source code file in a data repository and allows a developer to temporarily, or even permanently, rollback to an earlier version. For instance, it is not uncommon when modifying code that is functioning correctly, that modifications made to the code may cause it to stop functioning. In such a scenario, a developer can revert the source code file to an earlier version that was functioning correctly.

VSS was not significantly upgraded by Microsoft over the years and, as a result, lacks many of the more advanced features offered by competing products. Due to this, VSS is commonly the target of criticism by development teams. However, VSS is an affordable source control solution that is well suited to small teams and projects. VSS 2005 has been upgraded to include functionality for supporting XML file types and for upgrading to TFS.

Team Foundation Server

In an effort to meet developer needs and requests and offer a leading product in the source control market, Microsoft released Team Foundation Server (TFS). TFS is an enterprise-level source control product that fully manages application source control and the application development cycle. The TFS source control explorer is shown in the following figure.

TFS offers leading source control functionality as well as:

  • Issue tracking and management: issues include bugs found in an application, errors received, suggestions made by users, etc. Each issue can be tracked in the data repository and assigned to a developer for resolution. Each issue is referred to as a "work item". The following figure shows the TFS Work Items manager.
  • Application build control: multiple versions of an application can be scheduled for automatic build and deployed to differing target locations. For example, a development version of an application may be built overnight and deployed to a test environment while the test version may be built and deployed to a training environment in the same night.
  • Support for distributed development teams: It is a challenge to get a VSS data repository to be accessible over the Web due to performance issues. However, TFS is streamlined and optimized for distributed and remote access so that development teams can be easily comprised of members across the globe while all have access to the central TFS data repository.
  • Integration with management tools: Project managers can track all facets of application development by incorporating Microsoft Project into TFS. Furthermore, TFS integrates with Microsoft SharePoint Server and provides real-time status reports by using a SharePoint portal.
  • Integration with SQL Server 2005: TFS stores data related to a development project in SQL Server 2005 whereas VSS stores data in a proprietary data repository. Hence, performance is greatly increased in TFS and the product and data repository are even extensible.
  • Integration with Visual Studio 2008 Team System: When TFS is installed, a Team Explorer is available in Visual Studio that allows a developer to view and manage all aspects of all projects that the developer is involved in.
  • Granular security and permissions: TFS provides the ability to manage users, roles, and permissions at a very granular level.

Coverage of Team Foundation Server is beyond the scope of this course.

Configuring Visual Studio 2008 For Source Control

When Visual SourceSafe is started for the first time, a new data repository must be created by using the Add SourceSafe Database Wizard. If VSS does not detect an existing data repository, you will automatically be prompted with the wizard. The wizard is fairly straightforward with the following exceptions:

  • Team Version Control Model: This determines how source code files are managed by VSS. The Control Model page in the wizard is shown below.
    • Lock-Modify-Unlock Model: If you select the Lock-Modify-Unlock model, it is analogous to pessimistic database locking; there is a much smaller possibility of a modification conflict between development team members but, at the same time, the file will be locked while any other developer is making a modification to a file so that only one development team member at a time may modify a file.
    • Copy-Modify-Merge Model: If you select the Copy-Modify-Merge model, it is analogous to optimistic database locking; there is a greater possibility of a modification conflict between development team members but, at the same time, the file will be accessible to multiple developers simultaneously.

All Silverlight source code files are compatible with existing source control products. Silverlight projects can be added to Visual SourceSafe either directly through the VSS interface or through Visual Studio. Managing a Silverlight project through Visual Studio is typically easier and more intuitive for developers.

Once Visual SourceSafe is installed, projects can be managed by using Visual Studio either from the File menu or from the Solution Explorer. The figure below shows the File menu options.

Furthermore, when a new project is created in Visual Studio 2008, it can automatically be added to source control by selecting the Add to Source Control checkbox as shown in the following figure.

When a project is added to source control, the Visual SourceSafe login dialog is presented as shown below.

When a file needs to be modified, right-click the file in the Solution Explorer and select Check Out for Edit. The Check Out for Edit dialog allows you to enter comments to document why the file is being checked out.

When a modification is complete, a file can be checked back into source control as shown below.

Configuring Expression Blend For Source Control

The latest version of Expression Blend is a preview version that was released in December 2007. As of the current version, Expression Blend does not offer integration with a source control provider. However, as stated above, all Silverlight project files can be incorporated into source control and Visual Studio 2008 provides extensive source control integration support. Hence, until Expression Blend offers source control integration, simply use Visual Studio 2008 or the source control software interface to manage Silverlight application files.

Lab: Integrate Source Control

In this lab, you will integrate Visual SourceSafe with a Silverlight project and track modifications.

Team Development Using Silverlight Conclusion

In this lesson of the Silverlight tutorial, you

  • Reviewed source control basics
  • Managed multiple versions of a XAML file by using Visual SourceSafe
To continue to learn Silverlight go to the top of this page and click on the next lesson in this Silverlight Tutorial's Table of Contents.

Use of this website implies agreement to the following:

Copyright Information

All pages and graphics on this Web site are the property of Webucator, Inc. unless otherwise specified.

None of the content on this website may be redistributed or reproduced in any way, shape, or form without written permission from Webucator, Inc.

No Printing or saving of web pages

This content may not be printed or saved. It is for online use only.


Linking to this website

You may link to any of the pages on this website; however, you may not include the content in a frame or iframe without written permission from Webucator, Inc.


Warranties

This website is provided without warranty of any kind. There are no guarantees that use of the site will not be subject to interruptions. All direct or indirect risk related to use of the site is borne entirely by the user. All code and explanations provided on this site are provided without warranties to correctness, performance, fitness, merchantability, and/or any other warranty (whether expressed or implied).

For individual private use only

You agree not to use this online manual to deliver or receive training. If you are delivering or attending a class that is making use of this online manual, you are in violation of our terms of service. Please report any abuse to courseware@webucator.com. If you would like to deliver or receive training using this manual, please fill out the form at http://www.webucator.com/Contact.cfm.