Welcome to MSDN Blogs Sign in | Join | Help

View This Blog In

Teamprise: Enabling TFS collaboration across heterogeneous platforms

Development teams and organizations often have many different platforms and development environments, and interoperability between those heterogeneous environments is a major collaboration challenge.

Teamprise’s Client Suite addresses those interoperability gaps by enabling developers using Eclipse and Eclipse-based IDEs on multiple operating systems, including Windows, Unix, Linux, and Mac OS X to build applications that leverage Microsoft Visual Studio Team Foundation Server.

I’m happy to announce today that Microsoft has acquired the Teamprise technology. 

Microsoft is committed to the future of this technology and will be incorporating these tools into Visual Studio 2010.  This will be available as part of the Visual Studio 2010 launch wave.  

The acquisition of the Teamprise technology is an important step in our continued commitment to interoperability and our dedication to enabling customers to achieve greater business results, regardless of their current development environment.

Details of the acquisition are available on Microsoft PressPass.

Namaste!

Developing for the web using VS 2010 and .NET 4

Visual Studio 2010 and .NET 4 are packed with new features and enhancements designed to improve developer productivity.  Some are small changes and others are more significant.  Altogether they deliver a significant gain in productivity.

More and more developers look to the web to be able to build and deliver applications that take advantage of the reach and friction-free capabilities of the web.  With Visual Studio 2010 and ASP.NET 4, there are a number of new features to help you do just that.  I want to highlight a few of the new features here.

Snippets for HTML, ASP.NET and JavaScript

C# and VB users have used snippets for years to accelerate developer productivity.   Now web developers can experience these same productivity gains with their HTML and ASP.NET markup and JavaScript.  There are hundreds of new snippets that help you auto-complete common ASP.NET and HTML tags, including required attributes (such as runat="server") and common attributes specific to a tag (such as ID, DataSourceID, ControlToValidate, and Text).

Snippets

 RadioButtonList snippet

Dynamic IntelliSense for JavaScript

One of the biggest challenges developers face when coding with dynamic languages such as JavaScript is that types are dynamically being added and changed.  This is can render IntelliSense almost useless.  In Visual Studio 2010, the JavaScript IntelliSense engine has been redesigned to work smoothly for dynamic types.  For example, you’ll now get IntelliSense for types generated by registerNamespace.  The engine also adds support for most common JavaScript libraries.  Below is an example of IntelliSense for a newly-registered type with a new function.

JavaScript IntelliSense 

Streamlined Web Deployment

Web deployment has always been a very challenging problem for web developers.  Application logic, databases, IIS settings, data and configuration transforms all may need to be applied before deployment.

Now, MSDeploy, a new deployment tool, packages all the settings, files and data associated with a web application.  These packages can then be deployed to remote sites or archived for future retrieval. The IIS7 management console now includes a wizard to import packages created by MSDeploy.

Visual Studio 2010 seamlessly integrates MSDeploy into the web development workflow and adds commonly-requested features such as automation of web.config transformations to modify common settings (such as web service end points and connection strings) and database deployment before moving from a developer’s machine to a staging or production server.  Below is the new simplified publishing dialog:

MSDeploy 

New Application Templates

Getting started with web development can seem daunting for the new web developer. Visual Studio 2010 includes starter web application templates for ASP.NET 4.  These templates include everything you need to get started: a master/content pattern for page consistency, menus, login, and CSS style sheets and jQuery for building JavaScript-rich apps.  These templates give you get a working web application right from the start so you can get to work adding your own functionality.

CSS Improvements

ASP.NET controls now have a ClientIDMode property that allows you to change how ASP.NET controls generate the ClientID.  Knowing the ClientID is particularly important when styling with CSS or writing JavaScript to access the HTML DOM.

The HTML designer in Visual Studio 2010 has enhanced support for CSS 2.1 that provides a more accurate rendering at designtime compared with how the browser will render the page at runtime.

More Screen Real Estate

One of the most valuable commodities in a development environment is screen real estate.  Visual Studio 2010 offers an immense array of options developers can customize to optimize their screen real estate and development experience.  The Code Optimized Web Profile optimizes these settings to maximize screen real estate and bring the commands most commonly used by the Source View developer to your fingertips.  You can choose the Code Optimized Web Profile when you start Visual Studio for the first time or change your profile later using the Tools | Import and Export Settings… menu item.

Code Optimized Profile 

Clean Web.Config

Sometimes less is more.  This is one of those features.  When ASP.NET was first introduced, a web.config file wasn’t even required.  When it was, it often only contained a few entries.   As new capabilities were added to ASP.NET, the web.config file grew in size and complexity, making the file more difficult to read and maintain.  ASP.NET 4 brings back the minimal configuration file.

URL Routing with ASP.NET WebForms

URL routing is a feature common to MVC projects.  ASP.NET 4 supports URL routing for web forms.  Now you can define URLs that are meaningful to your app and understandable by users.  These simplified URLs also help with search engine optimization (SEO).

Learn More

This is only a sample of the improvements for web developers in Visual Studio 2010.  You can see a complete list of new features for web development here.

 

One More Thing... 

If you have been using Visual Studio 2010 Beta 2, we'd like to hear from you.  Please take the survey and tell us about your experiences.

 

Got Feedback?

 

Namaste!

Spec Explorer: A Model-Based Testing tool

Thorough, consistent, and extensible testing of systems remains one of the biggest challenges in creating and maintaining software systems.

The Spec Explorer tool released today on DevLabs tackles that problem using Model-Based Testing techniques.

Spec Explorer 

What Is It?

Spec Explorer, is a tool for modeling software behavior and generating test suites from those models. 

Models can be viewed as graphical renderings to understand and analyze the expected system behavior and communicate it to others.  Model size can be scoped with regular expressions.  The generated test suites can be run standalone in the Visual Studio test framework or other unit test frameworks.

Why Use It?

Several Microsoft projects of various sizes have already used Spec Explorer as part of their development process.  Using Spec Explorer has helped those teams create test cases more quickly, ensure predictability of requirement coverage, and support the projects’ lifecycle management and software updates.

Spec Explorer’s unique features make it easier to learn than other Model-Based Testing tools. Engineers with no modeling background can create models of systems and features, then generate tests in a short amount of time.  Studies on a large-scale project with over 300 test suites have shown a 42% average productivity gain over manually-created test suites.

While we’ve tuned Spec Explorer based on the feedback of teams within Microsoft, we now need your feedback to ensure Spec Explorer meets the needs of customers working on a variety of project types and sizes. 

Download Spec Explorer today, ask questions or send feedback via the forum, and stay current via the team blog.

Namaste!

Come meet the new MSDN

MSDN

 

The MSDN Global Network is re-launching with a new design and new benefits for all MSDN subscribers.

 

MSDN subscriptions are the ultimate resource that give developers, teams, and organizations comprehensive access to Microsoft tools and technologies to confidently design, develop and test software solutions. Along with access to thousands of downloads, it offers professional support services and expert information resources to ensure developers can rise to the biggest challenges.

 

Today, we are announcing new benefits to better support developers and to help them grow their career.  All MSDN and BizSpark subscribers will be able to leverage free e-learning courses in English.  We are providing priority support to all subscribers through MSDN Forums.  We are also announcing free Windows Azure Platform cloud computing use for MSDN Premium and BizSpark customers following Windows Azure commercial availability.  To kick start developers on this powerful platform, subscribers will get 750 free compute hours per month for 8 months. 

 

The MSDN network re-design supports our customers around the world, including 37 international sites. The goal of the new design is to improve the overall experience with the site and centers and help you be successful with the Microsoft products and technologies you have invested in. The new MSDN site includes a new visual design, new ways for the community to interact on the content, and new Silverlight controls to promote dynamic community content. This includes a Community Activity area featuring recent and most popular forums topics, code samples, and technical articles. The MSDN Library now has the ability to explore two new library views: ScriptFree (which sets the bar for performance by eliminating scripts and server round-trips) and the Lightweight Beta (a similar view to VS 2010 offline help experience).

 

This is just the start of an important investment we are making around our online assets to improve discoverability, readability, consistency, and relevance.

Feedback from MSDN users is crucial to making MSDN the best place to go from ideas to solutions. Thank you to everyone who has provided feedback and recommendations to make MSDN a better place. We are looking forward to hearing your additional input on the MSDN Site Feedback Forum on how to make MSDN even better. 

Namaste!

Announcing Visual Studio 2010 and .NET FX 4 Beta 2

 

I am pleased to announce the release of Visual Studio 2010 and .NET Framework 4 Beta 2.  MSDN subscribers can download Beta 2 today.  The beta will be available to the rest of the world on Wednesday. 

Visual Studio 2010 has made significant enhancements since Beta 1.  We’ve come a long way in performance and general stability, and while there is more work to do before we release Visual Studio 2010, we hope you’ll like what you see. 

Beta 2 also includes integrated tooling for SharePoint, including project templates and debugging support, and runtime and tooling support for developing great Windows 7 applications. 

Since Beta 1, new Windows Azure Tools templates make it easy to get started developing Windows Azure applications, and enhanced support for Silverlight 3 databindings let you focus on writing your code. 

Team Foundation Server is now included in all versions of Visual Studio 2010 with MSDN.  For small teams that need only core development features such as source control, bug tracking, and build automation, TFS Basic offers a simple, streamlined install and runs on server or client machines.  Test Elements users will notice a more intuitive and responsive user interface.

We’ve been making improvements to the .NET Framework as well.  I’m happy to say that the download size of .NET Framework 4 Beta 2 is greatly reduced from previous versions of the .NET Framework, with most flavors coming in under 50 megabytes.  Significant improvements to WPF’s text rendering stack make text sharper.  You will notice sharper text in the Visual Studio 2010 editor. 

We are also announcing a simplified product lineup and pricing options today, as well as new benefits for MSDN subscribers.  For MSDN Premium subscribers, the “Ultimate Offer” will offer access to the next level of Visual Studio 2010 at launch on March 22, 2010.  Find out more about the new product lineup and the “Ultimate Offer” here.

Visual Studio 2010 Beta 2 is available today for MSDN subscribers and will be available October 21st for public download. Keep an eye on the Visual Studio 2010 Product Page for or sign up to be notified when it becomes available.  The team and I are looking forward to hearing your feedback.

Namaste!

F# in VS2010

With Visual Studio, we strive to give your organization the tools to tackle a broad range of software problems with the interoperability and efficiency that you need and have come to expect from software based on the .NET Framework.

 

As part of this, Visual Studio 2010 marks the first release to directly support functional programming through the F# programming language.

 

F# is a highly productive .NET programming language combining functional programming and object-oriented programming, and is ideally suited for parallel, algorithmic, technical and explorative development.  F# is the result of a close partnership between Microsoft Research and the Visual Studio team, and since announcing F# in Visual Studio 2010 we’ve seen a surge of interest and uptake in the language. We’ve also worked closely with the F# community and major adopters to ensure it meets the needs of professional software developers working in these domains.

 

F# brings many new features to Visual Studio 2010, covering everything from “programming in the small” with Tuples and functions to simple, error-free asynchronous programming and strong types for floating point code.  Below are a few of the highlights of this addition to the Visual Studio languages.

 

Simple, Succinct Syntax

F# is a strongly-typed language like C#, but with a lightweight syntax often seen in a dynamic language like Python.  This gives your F# programs a lightweight, math-like feel.

 

let data = (1,2,3)

 

let rotations (x, y, z) =

    [ (x, y, z);

      (z, x, y);

      (y, z, x) ]

 

let derivative f x =

    let p1 = f (x - 0.05)

    let p2 = f (x + 0.05)

    (p2 - p1) / 0.1

 

let f x = 2.0*x*x - 6.0*x + 3.0

 

let df = derivative f

 

System.Console.WriteLine("The derivative of f at x=4 is {0}", df 4.0)

 

When run, this program will print: “The derivative of f at x=4 is 10

 

Parallel and Asynchronous Programming

.NET Framework 4 and Visual Studio 2010 contain great libraries and tools for easy parallel application development.  F# complements this with language features designed to make parallel and asynchronous programming more intuitive.  This includes fundamental language features like immutability and first-class functions, and powerful programming models, such as asynchronous workflows, which let you write asynchronous code in the same linear style as the synchronous code you are used to. 

 

let http url =

    async { let req =  WebRequest.Create(Uri url)

            let! resp = req.AsyncGetResponse()

            let stream = resp.GetResponseStream()

            let reader = new StreamReader(stream)

            let! contents = reader.AsyncReadToEnd()

            return contents }

 

let sites = ["http://bing.com"; "http://microsoft.com";

             "http://msdn.com"; "http://msnbc.com"]

 

let htmlOfSites =

    Async.Parallel [for site in sites -> http(site)]

    |> Async.RunSynchronously

 

 

Integrated with Visual Studio 2010 and .NET 4

F#’s integration in Visual Studio 2010 includes project templates, IDE support, IntelliSense and integration of the F# Interactive tool window.  F# can be used to develop applications and components targeting .NET 2.0 through .NET 4 and Silverlight.  As a .NET language, F# can be used comfortably alongside C# and Visual Basic.NET.  And in .NET 4, core types that F# uses, such as Tuple, Lazy, and BigInteger, are now part of the .NET Framework and can be used across all .NET languages.

 

The F# Interactive tool window enables an explorative development style within Visual Studio.  Below you can see the F# source code for an F# script open in the Visual Studio editor and the F# Interactive tool window where code is executed interactively.  At the top right is the Form and graphics that the script has created. 

 

F# Interactive tool window

 

Units of Measure

One ground-breaking feature of F# is Units of Measure, which allows you to annotate your floating point code with units, such as meters and seconds.  This is simple to do, and errors will be reported during development when code combines units incorrectly.  This provides compile-time checking of the correctness of floating-point code without sacrificing performance.

 

Units of Measure

That’s a quick look at just a few of the exciting features of F#.  For more on F#, visit the F# Development Center on MSDN.

 

Namaste!

Making your application sparkle with Windows 7

The launch of Windows 7 is just around the corner.  Whether you prefer managed or unmanaged development, you can take advantage of Windows 7 features with new APIs and libraries to make your application shine.

 

Multi-Touch

Touch-based interfaces allow users to interact with applications in a more intuitive way.  Windows 7 introduces multi-touch input and manipulation processing through Windows Touch. 

 

For native C++ developers, MFC now supports using a touch-enabled interface.  MFC will do much of the heavy lifting: it listens for touch-related messages from Windows and calls out to a number of virtual functions to handle them.  Developers merely need to register for touch input, set the gesture configuration, and override these virtual methods as required to touch-enable their application.

WPF 4 includes object model additions for touch interfaces so managed code developers can easily add touch support to their applications as well. Multiple finger input will be exposed through existing and new input events, while new manipulation and inertia events will be exposed for developers to consume.

 

Ribbon

Adding a Ribbon to your application can help organize your commands, tasks, and menus in a friendly way that makes it easier for your customers to find what they’re looking for.  Whether your application is written in Win32, MFC, or WPF, new controls and APIs will help you add a Ribbon to your application.

 

If you write Win32 applications, the Ribbon framework provides a set of APIs for creating a Ribbon for your application.  You can find out more about the Windows Ribbon Framework for Win32 here.

 

Visual Studio 2008 SP1 added support for an Office “look and feel” Ribbon UI to MFC applications.  Visual Studio 2010 adds “look and feel” support for the Windows Ribbon, including an MFC Ribbon designer to make creating and editing ribbons much easier.  An XML format for persisting Ribbon designs simplifies UI development by removing the need to “design in code”.

 

Ribbon Designer 

 

The new WPF Ribbon Control will be released out of band around the same time as WPF 4 through the Office UI Licensing site.  You can find instructions on downloading the WPF Ribbon (currently in Preview) here.  The WPF Ribbon will feature skins for Windows 7 and Office and all the standard Ribbon features that users are familiar with, including tabs and groups, dynamic resizing, quick access toolbar, application menu, contextual tabs, key tips, and more!   The Ribbon will remain available as a separate, standalone assembly.

 

Location

Windows 7 features the Location platform, which makes it easy to write applications that can make use of the user’s location.  The Location platform opens the doors to some interesting application scenarios – especially on mobile computers.  For example, a location-aware application might use the current location to show the user nearby restaurants or shops, or an instant messaging or email application might tag messages with the sender’s location.  

 

The Location platform provides a way for location devices, such as GPS and WWAN radios, to integrate with Windows and includes an API that applications can use to determine the current location of the computer.  Because the Location API exposes its functionality through COM interfaces, C++ programmers and scripting language programmers alike can take advantage of it.  The Windows 7 SDK includes samples and documentation to help you build location-aware applications.  Find out more about the COM Location API on MSDN. 

 

In addition to the COM Location API, .NET Framework 4 will include built-in managed APIs for location, making it easy for .NET applications to take advantage of Windows 7’s location capabilities.

 

Shell Integration

Windows 7’s Shell enhancements empower application authors to provide a richer integrated user experience.  Jump Lists provide access to contextual startup tasks and files available to the applications.  For instance, right-clicking on the Outlook icon will show the mail messages you’ve recently opened in the Jump List:

 

Jump Lists 

 

The new taskbar is less cluttered and can convey more information at a glance.  The taskbar allow you to pin any program to the taskbar or rearrange the icons on the taskbar by clicking and dragging.  Aero thumbnails, which appear when you hover over an icon in the taskbar, support view customization and user commands.  Below is an Aero thumbnail that supports commands for controlling media playback.

 

Aero thumbnail user controls 

 

MFC adds support for new Windows 7 shell features.  By default, files opened by an MFC application through the “File Open” dialog will be added to your recent files Jump List.  If you wish to override the default behavior, MFC also provides APIs that allow you to customize the contents of your application’s Jump List.  MFC has also added support for High DPI and many of the new Windows dialog features. Below, the Open File dialog has been customized with additional controls:

 

Customizing the Open File dialog 

 

Adding MFC support for Search, Preview and Thumbnails was an obvious choice. Now you can search your MFC documents in Explorer’s search field and see Icons and Previews just like Office applications. 

 

Search

 

If your application’s installer needs to access or update files that may be locked or in use, Restart Manager can handle application shutdown and restart, or eliminate or reduce the number of system restarts required for an install.  With just a few lines of code, you get full Restart Manager support with automatic timed backup of currently opened documents. MFC has added support for the Transactional File System in ATL as well.

 

These new MFC features will be available in Visual Studio 2010.  To take advantage of some of these features (such as Jump Lists), you will only need to recompile to get the updated user experience, while for others (such as Windows Touch or Restart Manager support) you will need to add a few lines of new code to incorporate new functionality.

 

WPF 4 allows you to use Windows 7’s new Shell features in your WPF applications as well. WPF 4 integrates Windows 7 Jump List functionality, including Tasks, Items, Recent and Frequent Lists, and Custom Categories. Windows 7 taskbar integration in WPF 4 includes progress bars, overlay icons, thumbnail buttons with command support, description text, and Desktop Window Manager (DWM) thumbnail clipping.

 

Learn More

This is just a taste of the ways you can build great Windows 7 applications.  For more information, visit the Windows Team Blog and MSDN’s Windows 7 Developer Guide.

 

Namaste!

Walking down memory lane...

Sometimes, we get caught up in what we are currently doing, the day-to-day stuff, the impending deadlines and the like.  Once in a while, it is good to take a step back and reflect upon the jounrey - the why, the what, the how and the where.

Recently, I got such an opportunity when I got a call to come in for a video-shoot for the Visual Studio documentary.  I wasn't sure what to expect or what the end product was going to look like but given my epxerience with Channel 9 from the past, I said let's take a bet and do it.  It was fun doing it.

The team completed this project recently and earlier today posted the Visual Studio documentary (part 1 and part 2) up on Channel 9.

I found it interesting particularly to hear from some of my colleagues including Anders Heljsberg, Dave Mendlen, Jason Zander and Scott Guthrie who all have been a part of this product line for a long time.  Hope you find this enjoyable.

Namaste!

Announcing WebsiteSpark

WebsiteSpark Logo 

The web has dramatically changed the software industry over the past 15 years. Today it’s hard to imagine business without the web. Nearly all businesses have or are creating a presence on the web to promote or sell their products and services, find new customers, or support existing ones. At the same time, the web has spawned a massive new ecosystem of web professionals – developers and designers who are focused on helping these businesses thrive.  

 

Many businesses, particularly small businesses, face the challenge of how to start building their web projects. That’s why I’m excited to announce the availability of the WebsiteSpark Program, a new program designed to help jumpstart web development and design for companies of up to ten members. As the latest offering in the ‘Spark’ family, including BizSpark and DreamSpark, WebsiteSpark builds on the legacy of these successful programs to provide software, support, and opportunities for web professionals everywhere.

 

Although Microsoft has always encouraged small companies to use our technologies, we’ve found that there was market gap in the area supporting small web consulting and hosting companies. About 5 months ago we conducted a survey of over 200 web professionals on both Linux and Windows platforms, and this gap was glaring; although many companies offer similar programs with “free software” or “free/community support,” we discovered that what these companies really wanted – and needed – was the ability and network to help drive business to their companies. Given our commitment to web developers who work in all types of organizations, we added WebsiteSpark to our portfolio to help these companies be more successful.

 

With WebsiteSpark, eligible companies can receive design and development software licenses and processor licenses with no up-front costs. In addition, they will receive support and training, as well as access to a broad marketplace that enables them to connect with prospective customers worldwide and feature their offerings in Microsoft marketing vehicles. The marketplace portal will be available later this fall.

 

In a nutshell, the WebsiteSpark Program makes it easier for companies to access and build on the Microsoft Web Platform, which offers web developers and designers around the world a robust environment for innovating on the web.

 

That’s why, in conjunction with today’s announcement on the WebsiteSpark program, I am also announcing the release of Web Platform Installer 2.0 and Windows Web App Gallery 2.0. 

 

This release of Web Platform Installer simplifies installation and includes new additions such as IIS Media Services and the Windows Azure SDK. Coupled with the App Gallery, developers can also access dozens of free, open source, and ready-to-install applications to help build their websites. Today more than 20 new apps are available from both Microsoft and the community, including new additions Moodle and Sugar CRM alongside other popular web applications such as WordPress, Drupal, DotNetNuke and many more.

 

For more information about the WebsiteSpark Program, including who is eligible, visit www.microsoft.com/web/websitespark

 

You can download Web Platform Installer 2.0 and Windows Web App Gallery at http://www.microsoft.com/web.

 

Namaste!

Doloto on DevLabs

AJAX web applications bring a variety of rich user experiences to the web, but often those experiences require downloading a lot of code.  The result is applications that are frustratingly slow to load and taxing to web servers.

Today we are announcing the availability of Doloto on MSDN DevLabs Doloto is a tool that makes pages more responsive by decreasing the initial download size of complex AJAX web applications.

Doloto analyzes AJAX application workloads and automatically performs code splitting of existing large web applications. Doloto enables applications to initially transfer only the portion of client-side JavaScript code necessary for application initialization. The rest of the application’s code is replaced by short stubs; their actual function code is transferred lazily in the background or on-demand on first execution. Since code download is interleaved with application execution, users can start interacting with your web application much sooner without waiting to download code that implements features they’re not currently using.

How it Works

Doloto is a standalone client-side tool.  Its wizard guides you through the following three steps:

 

1.     Doloto profiles your application. Doloto performs profiling by running a local proxy on your machine that intercepts JavaScript files and instruments them to capture timestamps at runtime for every JavaScript function in a browser-independent manner.

2.     Profiling information is used to calculate code coverage and a clustering strategy. This determines which functions are stubbed out and which are not and groups functions into batches which are downloaded together, called clusters.

3.     Doloto rewrites JavaScript code.  It then saves it to disk so that you can upload it to the server. The entire process happens on your machine, without needing access to the server. This way, you can profile and optimize the JavaScript of a any third-party site without special access to their servers. When you are satisfied with Doloto’s results, you can deploy the rewritten files to the server.

 

Show Me Some Results!

In our experiments across a number of AJAX applications and network conditions, Doloto reduced the amount of initial downloaded JavaScript code by over 40%, resulting in startup often faster by 30-40%, depending on network conditions.  The chart below shows savings in the amount of downloaded JavaScript code across a range of popular web sites required for the initial application loading phase.

 

Doloto download savings 

Download and try Doloto today, and share your thoughts and experiences on the project’s forum.

 

Namaste!

Architecture Tools in VSTS 2010

Designing new functionality on existing applications can be daunting.  There are always differences between the original design and the current implementation. 

 

The new Architecture tools within Visual Studio Team System 2010 help you understand the application you have, design new functionality you need, and validate that your design and your implementation do not deviate.

 

Understanding What You Have

Understanding the dependencies between parts of your application can be critical to determining where you may have problems.  Additionally, having a visual graph can help you find the best place to implement new functionality. 

 

You can get a big picture view of your solution by assembly, namespace, class or a custom filter in a Directed Graph Markup Language document (DGML) using the Generate Dependency Graph feature:

  

Generate Dependency Graph

 

The DGML document generated from your solution can be visualized as a Dependency Matrix, Force Directed Layout, or as a Top to Bottom layout, as shown below.  Each view can provide a different take on the structure of your project.

 

Top to Bottom Layout

 

This high-level view is a great way to understand the overall shape of your architecture, but understanding the dependencies for an area you need to change can make the difference between a fifteen-minute change and a one-hour change.  For instance, being able visualize the relationships around the Cart class can be very helpful in making changes to the shopping cart:

 

Cart Class 

 

Another valuable way of understanding how your application works is to be able to visualize the sequence of calls that happen in key sections of your application.  The Generate Sequence Diagram function, available in the code editor, will give you a view of the method calls your application makes.  Below, you can see the sequence of calls that make up the Add method implementation within the shopping cart. 

 

Sequence diagram 

 

Designing New Functionality

Now that you have a more complete understanding of your existing application, you are in a better position to add functionality.  Collaborating on design requires communicating in a standard way. Unified Modeling Language (UML) diagrams allow you to express your design in a way that others can understand.  For instance, you can build UML Component and Class diagrams that describe the existing structural elements of your design, then add new elements to the diagrams to illustrate and document your changes.  Below is how a completed Component diagram might look:

 

Component Diagram

A Class diagram might look like this:

 

Class Diagram

 

The Use Case diagram below enables teams to better understand and agree on the functions of the application.

 

Use Case Diagram 

Once you have a UML diagram, you can create or link designer elements to work items within Team Foundation Server’s (TFS) Work Item Tracking system. 

 

TFS Integration 

 

 

Ensuring Application Validation

Over time, the code quality of a project can degrade if bug fixes and new feature implementations are not done with overall architecture in mind.  This is where the Layer designer and Layer validation can help.  The Layer designer enables you to define the logical layers and valid communication paths between layers of your project.  Once you have associated assemblies, namespaces, and classes with layers in the Layer diagram, you can validate existing or new code against the layering constraints.  For example, in this Layer diagram, it is valid for software within the Presentation layer to have dependencies on software within the Business Logic layer.  However, since there is not a dependency line between Presentation and Resource Access, any software that attempts to take that dependency would cause a compile-time violation in the Error List.   

 

Layer Diagram

 

You can validate layer constraints from the designer surface, command line, or from within the build process.  Team Build’s gated check-in process ensures that layer constraint violations never make it into source control. 

These are some of the features in Visual Studio Team System 2010’s architecture tools.  You can get more information about these and other features at Cameron Skinner's blog.

Namaste!

VB and C# enhancements in VS 2010

Choosing a programming language is a personal choice that each programmer gets to make.  It is akin to choosing a flavor of ice cream - there are many great options out there, but your favorite flavor is a matter of personal preference. 

 

In Visual Studio 2010, we’ve made several enhancements to our two most popular languages, Visual Basic and C#, to give programmers all the tools they need to build great software no matter which language they prefer.

 

Visual Basic

The Visual Basic team focused on adding productivity features to the language so developers can get more done in fewer lines of code.  The most common customer request for Visual Basic is to remove the underscore (“_”) character when breaking a code statement across multiple lines in most cases.  Visual Basic 10 introduces implicit line continuation, which removes the need for the underscore character in most cases.

 

    Function Filter(

                    ByVal customers As List(Of Customer),

                    ByVal orderCount As Integer

                   )

 

        Dim query =

                    From c In customers

          Where c.Orders.Count >

                orderCount

                    Select c

 

Another new productivity feature is auto-implemented properties.  With auto-implemented properties, lines of boiler-plate property implementation code can be replaced with simple one-line declarations.  Previously, property declarations often looked like this:

 

    Private _FavoriteFlavor As String = "Butter Pecan"

 

    Property FavoriteFlavor() As String

        Get

            Return _FavoriteFlavor

        End Get

        Set(ByVal value As String)

            _FavoriteFlavor = value

        End Set

    End Property

 

    Private _FlavorList As New List(Of Flavor)

 

    Property FlavorList() As List(Of Flavor)

        Get

            Return _FlavorList

        End Get

        Set(ByVal value As String)

            _FlavorList = value

        End Set

    End Property

 

Now property declarations can be declared much more simply:

 

    Property FavoriteFlavor As String = "Butter Pecan"

    Property FlavorList As New List(Of Flavor)

 

Collection initializers and array literals are simpler as well.  Collections can now be initialized when they’re declared, and the type of array literals is inferred by the compiler.

 

    Dim toppings = New List(Of String) From

        {

         "sprinkles",

         "chocolate chips",

         "strawberries"

        }

    Dim cones = {"sugar cone", "waffle cone"} 'the type String() is inferred

 

 

Visual Basic 10.0 now has better support for lambdas.   Lambdas can now contain expressions that don’t return a value, as the Sub keyword indicates below:

 

    Array.ForEach(toppings, Sub(n) Console.WriteLine(n))

 

Sometimes you’d like to do more complex work inside a lambda declaration.  Visual Basic 10.0 supports multiline lambdas.  The compiler will infer parameter and return types where possible just like in regular lambdas.

 

    Dim doubleDown = Function(n As String)

                         If n.StartsWith("s") Then

                             Return "extra " & n

                         Else

                             Return n

                         End If

                     End Function

 

Interoperating with dynamic language code such as Python and Ruby has become simpler in Visual Basic 10.0.  For example, the following code snippet calls a method defined in a Python library “math.py”:

 

    Dim mathLib As Object = python.UseFile("math.py")

    Dim firstNumber = 44.2

    Dim secondNumber = 9.5

    mathLib.PowerOf(firstNumber, secondNumber)

 

 

C#

C# 4.0’s major themes are interoperability with dynamic programming paradigms and improved Office programmability.  Dynamic lookup, a new feature in C# 4.0, allows you to use and manipulate an object from IronPython, IronRuby, JScript, the HTML DOM, or a standard .NET library in the same way, no matter where it came from.  Language enhancements such as named and optional parameters and improved support for COM clients give C# developers who are working with Office APIs the same great experience that Visual Basic developers have enjoyed.

 

Adding the new dynamic keyword to your code allows its type to be resolved dynamically at runtime rather than statically at compile-time.  This allows dynamic languages to expose their objects to C# in a way that feels natural to a C# programmer:

 

    dynamic dynamicObject = GetDynamicObjectFromRuby();

    dynamicObject.Foo(7);

    dynamicObject.Property = "Property value";

    dynamicObject[0] = "Indexed value";

 

Optional method parameters are familiar to Visual Basic and C++ programmers and are now available for C# programmers.  Optional parameters are declared with a default value in the method signature, as follows:

 

    private void CreateNewStudent(string name, int currentCredits = 0, int year = 1)

 

The method above can be called in any of the following ways:

   

    CreateNewStudent("Chloe");

    CreateNewStudent("Zoe", 16);

    CreateNewStudent("Joey", 40, 2);

 

To omit the currentCredits parameter value but specify the year parameter, the new named arguments feature (highlighted) can be used.  All of the following are also valid calls:

 

    CreateNewStudent("Jill", year: 2);

    CreateNewStudent(name: "Bill", currentCredits: 30, year: 2);

    CreateNewStudent("Will", currentCredits: 4);

 

Named arguments are also a great way to write self-documenting calls to your existing methods, even if they don’t use optional parameters.

 

Learn More

Find out more about Visual Studio 2010’s language enhancements and download samples on the VB Futures site and the C# Futures site.  To play with the new features, download and install Visual Studio Beta 1, then join the conversation.

 

Namaste! 

 

Debugging, Profiling and Analyzing Parallel Applications

Any time a programming model is introduced, developers need robust tooling support for learning, writing, debugging and optimizing their code to make use of it.  This is particularly true for parallel programming, which adds a set of new variables to the equation.

 

Visual Studio 2010 has made great strides in the parallel debugging experience.  Many features are also available as add-ins for Visual Studio 2008.  Here’s a brief tour of the parallel programming, debugging, and diagnostic features available in Visual Studio 2008 and upcoming in Visual Studio 2010.

 

Debugging

Although Visual Studio 2005 had a simple built-in debugger for MPI programs, it did not provide a full “F5” experience.  The new add-in for Visual Studio 2008, which is also integrated into Visual Studio 2010, allows you to select a cluster head node, how many cores you want, and hit F5 to debug your MPI program. 

 

Debugging MPI programs

 

In addition to the great core work that the debugger team has done, Allinea, a leader in parallel debugging technologies, has ported their environment to Visual Studio.  Allinea’s add-in enables even further streamlined MPI-specific debugging, including rank based context switching, group-wise step, pause, and run, parallel stack view, and lamination.  Below is Allinea’s MPI debugging environment:

 

Allinea 

 

Service Oriented Architecture Debugging

One of the key new programming models introduced in Windows HPC Server 2008 was Cluster SOA, built on WCF with advanced scheduling and load balancing provided by HPC’s scheduler/broker.  Up until now, debugging Cluster SOA was limited to basic WCF/.Net style debugging with no cluster integration.  In Visual Studio 2010, an add-in for Cluster SOA enables the SOA Settings tab, allowing you to choose a head node, debug nodes and services, deploy runtime libraries and clean up automatically. Here’s a peak at the new SOA debugger in Visual Studio 2010:

 

SOA Debugging 

 

Profiling

Integrated MPI-aware profiling was not available in Windows Server HPC 1.0.  With Windows HPC Server 2008, tools such as XPerf enabled MPI profiling as well as system-level profiling and troubleshooting.  But even XPerf really didn’t know much about the details of MPI message traffic, and no message traffic viewers existed.  Since then, Vampir, the premier MPI message traffic viewer, has been ported to Windows and fully integrated with ETW.  Vampir allows you to troubleshoot message ordering and delays.  Various open source HPC tools are available as well, such as JumpShot, a free Java-based MPI message viewer.

 

Often times, the built-in VS Profiler can offer insight into performance issues.  In Visual Studio 2010, this capability has been fully integrated with the HPC job scheduler to help analyze the behavior of a particular MPI rank or node.  The Visual Studio MPI profiler shows line-level profile information, including a temperature view of execution, side-by-side with source view:

 

Visual Studio MPI Profiler 

 

The profiler also shows a comparison report across multiple runs or builds so you can easily see the effect of your changes.

 

 Comparison Report

 

MPI Runtime Analysis

Beyond debuggers and profilers, sometimes you need specialized analysis tools to help with the complexities of large scale parallel programs.  HLRS/ZIH at Stuttgart, a leading institute in Germany, has ported Marmot, their dedicated MPI analysis tool, to Visual Studio 2008.  Marmot can be used to check the validity of parameters passed to MPI calls and detect irreproducibility, deadlocks, and incorrect management of resources.  Below is Marmot in action:

 

Marmot 

 

From Printf to Integrated Profiling and Debugging

In a world where printf-style debugging was the norm not long ago, state-of-the-art debugging and profiling tools have taken a major step forward. 

 

From within Visual Studio, you can debug and profile native as well has high performance MPI and Cluster SOA applications that scale from hundreds to thousands of cores.  You can use XPerf and ETW to get a truly holistic view of the application in the context of the whole system.  The new multi-core profiling and debugging tools that were introduced in Visual Studio 2010 can be effectively used on a cluster at the node-level as well.  

 

Visual Studio is becoming a rich and productive environment for writing parallel programs of all types.  To find out more about Windows HPC programming models, visit the Windows HPC Server Developer Resource Center.  You can find a suite of samples that use various parallel programming models on the CodePlex Parallel Dwarfs site.

 

Namaste!

From zero to a complete web application in minutes

Building a web application from scratch can seem like a daunting task.  You may have a good idea of what you would like your website to do, but deciding on the best technology to build your application, finding reusable code samples, and designing your site’s navigation and appearance can take a lot of time and energy. 

The Windows Web App Gallery is designed to help you get up and running with a customizable web application quickly so you can focus on building the code only you can write.

The Web App Gallery is a collection of the most popular web applications, such as DotNetNuke, Umbraco, ResourceBlender.NET, and mojoPortal, all free and ready for download and installation using the Web Platform Installer.  Web App Gallery contains both ASP.NET and PHP apps, and the platform for the application you choose is automatically installed with your application.  Most of Web App Gallery’s applications are open source as well.  Web App Gallery has had more than 500,000 downloads in the four months since it debuted.

Let’s take a look at how the Web App Gallery works.  To get started, we’ll take a look at the Web App Gallery.

 App Gallery

You can search for applications based on their popularity, user ratings, or by categories such as Content Management, Blogs, or eCommerce.  If you’re building a website for a business or club, for instance, you may want a Content Management application such as Umbraco.

When you click the “Install” button next to your app of choice, Web Platform Installer (Web PI) is launched.  Web PI is a tool that enables you to easily install both the Microsoft Web Platform as well as any of the web applications in the gallery and any additional dependencies your chosen web application requires.  From the Web App Gallery, the first screen shown during the Umbraco install is a details page giving further information about Umbraco.

 WebPI

At this point, you can click on any of the tabs on the left side to install more products from the Microsoft Web Platform, or you can immediately begin my installation of Umbraco.  If you need only Umbraco, choose “Install”.

 

You’ll be immediately shown the license terms for the products you’re installing as well as the other products you’ll be installing.  Web PI includes all the products you need to get your application running.  This may mean configuring the right IIS components, downloading ASP.NET, and installing SQL Server Express.  You don’t need to worry about anything other than the application you want to install.  Once you choose “I Accept”, Umbraco and all the other dependencies will be downloaded and installed for you.

Once this is complete, fill out the site you want to install Umbraco to as well as some basic information required by Umbraco.

 Site Information

You’re now done and ready to begin using your Web application. 

Launch Umbraco using the link on the installation screen, go through a few configuration steps, and you’re ready to start setting up your new web application.

 Umbraco Settings

Once you’ve spent some time with your web application, you can rate and review it on Web App Gallery, or you can submit your own web application to the Web App Gallery as long as it follows the Web Application Gallery Principles.  The Web Application Gallery is always adding more applications so check back regularly.

Namaste!

STM.NET on DevLabs

Today we made available STM.NET on MSDN DevLabs.  STM.NET is an experimental enhanced version of .NET Framework 4 Beta 1 that enables software transactional memory for C# programmers.

 

Transactional memory is a technology that frees developers from worrying about the mechanics of fine-grained locking and synchronization in multithreaded applications by providing transactional semantics for reading and writing to memory.  It enables developers to focus on application logic instead of the details of memory I/O when building multi-core and many-core programs.

 

Building Transactions

STM.NET makes it easy to declare a region of code as atomic. Simply write a function or lambda containing the code that you’d like to transact and pass it to the Atomic.Do delegate.  Just like SQL code in a database transaction, this block of code will run as if isolated from other transacted blocks and either it completes successfully or rolls back the complete transaction if there is an error, all without you having to explicitly lock anything.

 

How Does it Work?

The .NET Framework’s just-in-time compiler rewrites the code within an atomic block to use transactional memory.  As a result, a significant amount of .NET code works without changes, including code that uses locks.  STM.NET also provides integration with System.Transactions so you can coordinate your atomic memory operations with existing transactional resource managers like MSMQ.

 

One of the best aspects of STM.NET is its integration with Visual Studio tooling.  STM.NET works with the Visual Studio 2008 debugger to allow you to see the values of transacted variables as they appear while running inside the Atomic.Do delegate as well as their values as they appear outside.

 

STM.NET is available for download today.  Share your thoughts and experiences on the project’s forum, and read more about STM.NET on the STM.NET Team Blog. 

 

Namaste!

 

More Posts Next page »

Page view tracker