Visual Studio .NET Whidbey


The Whidbey release of Visual Studio .NET, its associated programming languages, and the underlying .NET Framework is expected to deliver some key enhancements. Within the Visual Studio .NET environment, enterprise development is expected to get a boost with integrated requirements gathering, software analysis and design, application configuration, testing, and change and project management support within the Visual Studio .NET toolset. The goal is to easily translate business requirements into a set of Web services and components using designers. Visual Source Safe is expected to be enhanced to support Web services projects.

Core .NET Framework Whidbey

The Whidbey release of the .NET Framework itself has some major features planned, including the following:

  • Improved no-touch deployment strategy, including the capability of rolling back an application to a previous version, listing applications in the Windows Start menu, adding/removing programs, and optional installation of the .NET Framework with an application.

  • An Active Document Container for Office documents, Office-style toolbar, intuitive splitter controls, managed Web browser control, layout controls, new master-detail capable data table component, managed sound control, and so on.

  • Support for new data access controls, such as Data Source, which work seamlessly with databases, XML content, and business objects ”GridView and DetailsView controls. Ability for pages to share layout across pages (for instance, identify the common location of toolbars , headers/footers, and so on) and support for themes/skins for ASP.NET Web applications.

  • C++ device application development support, additional controls for device-specific telephony features, such as messaging/SMS, and better COM interoperability.

  • Full tracing support in ADO.NET, easier manipulation of data using ObjectSpaces, making code data-provider independent, and XQuery support.

  • Web services enhancements; hosting Web services supporting TCP/HTTP communications using either managed executables or Windows service.

C# Whidbey

A key highlight for C# in the Whidbey release is the support of generics. Generics are similar to the templates capability available in C++ and provide a mechanism for creating classes, methods , structs, delegates, and interfaces that take type-based parameters. For instance, consider the following class. It is similar to a typical .NET class, the only major difference is that it accepts a type parameter.

 
 public class MyCollection<Type> {     private Type[] elements;     public void Add(Type element) {         ...     }     public Type this[int index] {         ...     }     ... } 

Generics that implement parametric polymorphism provide a host of benefits, particularly when it comes to compile time. For instance, consider the following application, which uses a generics-based collection. intCollection, for instance, is a collection of integers, and can be implemented by using a "normal" collection. However, storing integers into the collection would require boxing them into objects. At the same time, retrieving them would require type-casting. Without additional code, the collection object would typically throw no errors when strings and other objects are used because they are also downcast as object types. It is possible to create specific implementations of collections for integers, strings, Booleans, and so on separately, but that would require additional code bloat. Generics solve this problem in a much more elegant fashion, reducing code bloat and providing several performance enhancements as well; no further type-casting is required.

 
 public class UseGenerics {    public static void Main() {       MyCollection<int> intCollection = new MyCollection<int>();       intCollection.Add(1);       intCollection.Add(1111);       int first = intCollection[0];    } } 

Another enhancement of the C# language is support for the easy development of iterators for collections. For instance, with Whidbey, developing an iterator would be as simple as writing three lines of source code (as shown next ).

 
 public class MyCollection {    ...    public object foreach() {       for (int i = 0; i < count; i++) yield elements[i];    } } 

C# also is expected to support anonymous methods. Anonymous methods allow developers to encapsulate a block of code in a delegate that can be executed at a later time. This functionality is similar to that of the lambda function found in LISP or Python programming languages. The code snippet that follows shows an anonymous method used as an event handler to a button.

 
 using System; using System.Windows.Forms; class HelloForm: Form {    public HelloForm()    {       Button exitButton = new Button();       exitButton.Text = "Exit";       this.Controls.Add(exitButton);       exitButton.Click += new EventHandler(sender,e) {          Application.Exit();       };    }    public static void Main()    {       HelloForm hf = new HelloForm();       Application.Run(hf);    } } 

C# introduces the notion of partial types, which, through a new keyword "partial," allows the class file definition to be split across multiple source code files. For instance, the following two programs, PartialHello1.cs and PartialHello2.cs, together define the Hello class.

 
 //File: PartialHello1.cs public partial class Hello {       private String message;    public Hello(String message)    {       this.message = message;    } } //File: PartialHello2.cs public partial class Hello {    public String SayHello() {       return message;    } } 

Visual Basic .NET Whidbey

Visual Basic .NET Whidbey continues to be enhanced as the tool of choice for Visual RAD “based application development. The Whidbey release advances it further by creating a new set of runtime objects and methods that provide direct access to frequently used functionality of the .NET Framework, enabling significant reduction of source code.

Key highlights expected in this release are the following:

  • Using Visual Basic as a problem solving tool rather than worrying about the language syntax. For instance, a new capability provides VB developers with a " fill-in-the-blanks " approach to rapid development.

  • Integrated Word spellcheck-like syntax checker; Using Smart Tags, the IDE will provide suggestions to common errors to reduce programming errors at development time. Developers will be warned of semantically erroneous code that could be syntactically correct to minimize runtime errors.

  • Data access will be highly simplified and creation of the data bound application will be as easy as dragging a table into the layout canvas and then setting some properties. The goal is to have developers create data-bound applications without a single line of code.

  • This release also marks the return of the popular Edit and Continue methodology for modification of source code while the application is being debugged .

  • A set of language enhancements, including support for operator overloading, unsigned data types, inline XML-based documentation, partial types, and generics support.

Visual C++ Whidbey

Key highlights of enhancements to the Visual C++ Whidbey release include the following:

  • Support for developing mobile applications using Visual C++

  • A concept known as POGO (Profile Guided Optimizations), which allows instrumentation of an application while it is being used

  • Support for generics through managed extensions

  • Enhanced support for extending MFC applications to support the .NET Framework

Visual J# Whidbey

One of the key capabilities available in the existing Java programming language is to run applets within a Java-enabled browser, such as Microsoft Internet Explorer and Netscape Navigator. Even though applets ended up not being as successful as they were initially hoped to be, applets continue to be used to create a better interactive user interface for application elements such as menu bars, toolbars, and so on. A new feature called J# Browser Controls allows existing Java-based applets to be deployed in a browser window, similar to applets, but they run within the context of the .NET Framework. A beta release of J# Browser Controls was available at the time of writing this book at http://msdn.microsoft.com/vjsharp/downloads/browsercontrols/.

To understand how J# Browser Controls work, look at an example of how a simple Java applet can be converted into a Browser Controls “based .NET application.

The code that follows shows a simple HelloApplet. Java applets extend from the java.applet.Applet class and have to at least implement the init method. In this scenario, the applet contains a simple button that says "Hello World."

 
 import java.awt.*; import java.applet.*; public class HelloApplet extends Applet {    public HelloApplet()    {    }    public void init()    {       add(new Button("Hello World"));    } } 

After they are compiled using a Java compiler or a tool such as Visual J++, Java byte codes are generated into the file HelloApplet.class. The resulting class can then be referenced in an existing or new HTML Web page through the applet tag. If you have a Java-enabled browser, you should be able to navigate to the Web page and see the Java applet running.

 
 <applet code="hks.HelloApplet.class" width="100" height="100"> </applet> 

To use J# Browser Controls, after installation of the J# Browser Controls add-on, recompile the Java source file into a .NET library/DLL using the Visual J# compiler.

 
 vjc /target:library /out:HelloApplet.dll *.java 

SHOP TALK : ARE APPLETS OR BROWSER CONTROLS REALLY USEFUL?

Java created a lot of buzz with the introduction of applets. Applications could be delivered using the browser-based application delivery model, still providing a higher level of GUI capability interactivity, beyond what was available in standard HTML-based markup. However, applets never really took off big time beyond the small GUI menu bars, news tickers, and so on. Browser compatibilities and security issues always came in the way between large-scale applet-based application deployments. I would expect this to also be the case with Browser Controls; developers will probably create "mini-applications" that could be used to enhance the overall GUI experience of the user, but I don't really expect a significantly large application to be delivered through Browser Controls or applets.


If you prefer (for instance, if you don't have the original source code), you can use the Java-language byte code to MSIL converter utility jbimp.exe to use the class file as an input to generate a .NET assembly.

 
 jbimp /target:library /out:HelloApplet.dll hks\*.class 

After the assembly has been generated, you need to modify the HTML file to use the .NET assembly instead of the Java byte code. The J# Browser Controls Beta release included a tool called TagConvert, which provides automated HTML applet-to-object tag conversions. The utility is available in the installation directory of the Browser Controls software. (For instance, it was in the C:\Program Files\Microsoft JSharp Browser Control Utility directory of my workstation; C: being the operating system drive.)

 
 TagConvert HelloApplet.html 

The utility modifies the HTML file to use the object tag instead of the applet tag.

 
 <object  width="100" height="100"          CLASSID="clsid:a399591c-0fd0-41f8-9d25-bd76f632415f"          VJSCODEBASE="HelloApplet.dll#HelloApplet"> </object> 

If you open the modified HelloApplet.html file in your browser, you should see something similar to Figure 16.1.

Figure 16.1. Using Visual J# Browser Controls.

Apart from Browser Controls, other highlights of expected features in the Whidbey Visual J# Release include the following:

  • Support for creating enumerations and value types

  • Introduction of assert/volatile keywords

  • Support for consuming CLR generics



Microsoft.Net Kick Start
Microsoft .NET Kick Start
ISBN: 0672325748
EAN: 2147483647
Year: 2003
Pages: 195
Authors: Hitesh Seth

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net