Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
  What's New in .NET Framework 3.0  
 
 

Here is a list of some of the more prominent new features that I've encountered in .NET Framework 3.0. Please email me if you know of other significant features that should be listed here.


WPF - Windows Presentation Foundation

Windows Presentation Foundation is a whole new set of controls that duplicates many of the simpler controls provided by Windows Forms. However, the new controls support a whole new set of impressive graphical and interactive features.

For example, most controls can contain just about any other control as content. You can make a button that contains a grid that holds several labels, text boxes, pictures, or whatever else you like. This lets controls display much more interesting items than a simple caption.

WPF controls can contain fancy gradient backgrounds. You can define styles and templates that make it easy to give a whole form a distinctive look and feel. If you decide to change your buttons from a linear gradient fading from blue to green to a radial gradient that fades from yellow to orange, you can do it in one place in a few seconds.

WPF controls can contain triggers and take action in response. A button can change color, grow, shrink, spin, or produce other interesting (and easily abused) effects when the mouse moves over it or the user presses it.

One of the most important concepts in WPF is separation of user interface and the code behind it. Microsoft's idea is that a graphic designer will use a tool called Expression to build the user interface. Then a developer will add the code behind the controls.

Currently Microsoft does not plan to provide Expression to MSDN subscribers, a fact much lamented by developers who feel their company will not pay the extra cash for separate designers. It's unclear which Expression features will be duplicated in Visual Studio. Currently Visual Studio's WPF form designer doesn't work very well and to get the full advantage of WPF controls you need to design forms in XAML (Extensible Application Markup Language--pronounced "zammel"), the language that defines WPF forms. Hopefully Visual Studio's WPF form designer will improve greatly in the Orcas release.

Unfortunately WPF controls and Windows Forms controls don't work and play well together. You can host a Windows Form control on a WPF form and vice versa but it's not as easy as simply dropping a different kind of control on a form. The new WPF controls are also don't feel as consistent as the older Windows Forms controls.

For example, recent versions of the Windows Forms controls all use the same Text property to define their text. In contrast, WPF controls use a Content property to define the things they contain. The Content may be a control or it may be text. Except for the Window object (the WPF version of a Form), which needs both a Content property to hold the controls it contains and a Title property to define its title bar text.

Controls that display text also have separate FontFamily, FontSize, FontStretch, FontStyle, and FontWeight properties instead of a single Font property that has its own properties. Among other things, that means Visual Studio's WPF form designer doesn't have a nice font selection dialog. Breaking Font into multiple properties probably makes reading the XAML code easier for the compiler but exactly how do we make underlined italicized text?

WCF - Windows Communication Foundation

Windows Communication Foundation is a set of tools for service oriented architecture (SOA). It includes classes and methods for building client and server classes. Tools make building client classes relatively easy.

WCF allows clients and servers to communicate in several ways such as TCP, HTTP, named pipes, or message queues. WCF also include features to provide secure communications between clients and servers.

Unfortunately WCF giving you all of those options means it also requires quite a bit of configuration. Visual Studio doesn't provide a lot of help here so you typically build configuration files written in XML to configure clients and servers. Building these files isn't the end of the world but it does put back a lot of the complexity that other WCF tools remove.

WF - Windows Workflow Foundation

Supposedly this was originally called "Windows Workflow Foundation" and abbreviated WWF. But the World Wrestling Federation took exception to Microsoft's using the abbreviation WWF, the product was re-branded as WF. You'll probably see it called Windows Workflow Foundation, Windows Workflow, and Workflow in different documents.

Whatever its name, WF provides a group of classes that model different aspects of a workflow application. Different classes represent such actions as waiting for a specific event, branching depending on some condition, waiting for one of several occurrences, and performing a series of actions in sequence.

After you design a workflow, a workflow engine moves objects through the various workflow states until reaching an ending condition.

I don't really see the whole point of WF. It seems much easier and intuitive to build workflows with objects tracked in a database.

Windows CardSpace

CardSpace (formerly InfoCard) is a tool for building identity systems. Your application can allow users to define an identity to act on their behalf while interacting with your application. For example, eBay users have identities that eBay uses to provide information about how reliable buyers and sellers are. Similarly CardSpace users can create identities that other users cannot forge while interacting with your application.

CNG - Cryptography API: Next Generation

CNG promises a new, simpler object model for dealing with cryptography. It includes new ways to plug and play difference components such as custom random number generators. It also includes some new encryption algorithms.

Unfortunately there doesn't seem to be a good way to use CNG from managed code. The CNG library isn't a .NET assembly, doesn't expose itself through COM, and doesn't come with a type library (.tlb file). So for now Visual Basic and C# developers seem to be SOL.

UAC - User Application Control

User Application Control addresses a real issue that has been clinging to Windows for years. Some parts of the operating system are protected so a program must have administrative privileges to modify them. In previous versions of Windows, if a user regularly uses a program that needs those privileges, that user would just log on as an administrator. That lets the program work but puts the system at risk. If the user does something careless or runs a file containing a virus, the system may suffer a complete meltdown.

With UAC, Vista starts all users with normal non-administrator privileges-even for the true administrators! Then if a program needs more privileges, it displays a UAC privilege elevation dialog. Normal users must enter an administrator's username and password. Even if you are logged on as an administrator, you must confirm that you want to obtain elevated privileges. This confirmation allows you to do most of your work as a normal user and only acquire special privileges when necessary, and that will lead to a safer operating system.

UAC does require one fairly large change to your programming style, however. To work properly with UAC, you must avoid accessing the protected parts of the system whenever possible. For example, most applications are installed in the Program Files directory. That directory is protected by Vista so, if you install your application in that directory, the program must obtain elevated privileges to write in the directory where the program is installed. You can avoid this hassle by making your program write into a shared directory or into the users' private directories.

Similarly most of the Registry is off-limits without UAC elevation so you should try not to write to those parts of the Registry. Happily Visual Basic's SaveSetting, GetSetting, and DeleteSetting functions work with normal user privileges.

Finally, if you absolutely must write into a protected directory, fiddle around in a sensitive part of the Registry, or do something else that's verboten to normal users, you should isolate those parts of your application as much as possible. Then move those parts into a separate executable and mark it as requiring UAC elevation. Your main program can then invoke the auxiliary application and Vista will display the UAC elevation prompt. (It's a lot easier to use normal user permissions whenever possible and avoid the bother.)

Summary

WPF provides new features for making more interesting, effective, and dynamic user interfaces. Unfortunately these benefits come at a high price in performance. You will need a powerful computer with a large chunk of memory to run these applications effectively. However the benefits are big enough that it's likely that WPF will be an important new direction in Windows application development. Hopefully Visual Studio's WPF tools will improve greatly in Orcas.

Working with UAC is somewhat annoying in Visual Studio. You cannot request elevated privileges for a running application and you cannot easily launch a new thread or process with elevated privileges. Instead you must move any procedures that require elevated privileges into a separate executable and configure it to request UAC elevation. It would be nice if this got easier but I wouldn't count on it. UAC is still important enough and beneficial enough that you need to learn to work with it.

WCF, WF, and CardSpace are fairly complicated. It's not clear whether WF makes building workflow applications easier or harder. While WCF gives you lots of control and flexibility for building SOA applications, it's a lot harder than using a simple Web service. CardSpace is such an application-specific tool that I don't even know how to review it. If you need that functionality (I never have), perhaps you'll find it useful.

Finally CNG sounds great but when can Visual Basic and C# developers use it?

Links

Here are some Microsoft links to the products described here.

 

Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated