Upcoming Courses

Essential .NET
March 3rd-7th
Los Angeles
March 17th-21st
New York


NEW-Essential Windows Communication Foundation
February 26th-29th
Boston
March 17th-20th
Chicago


NEW-Essential Windows Presentation Foundation
February 18th-22nd
Bellevue, WA

March 10th-14th
Los Angeles


NEW-Essential Windows WorkFlow Foundation
March 10th-14th
Boston


.NET Architecture &
Design
February 11th-15th
Boston

March 17th-21st
New York


Essential SharePoint 2007 for Developers
March 10th-14th
Boston


NEW-Essential AJAX for ASP.NET Developers
March 17th-20th
Orlando


Essential SQL Server for Developers
March 3rd-7th
Boston


Essential C#
February 18th-22nd
Los Angeles


Essential BizTalk Server
February 25th-29th
Los Angeles


Essential Windows Forms
March 3rd-6th
Boston

 










The Zen of Volta
by Richard Blewett

In December 5th, 2007 Microsoft announced an incubation project they have been working on called Volta (http://labs.live.com/volta). The announcement talked about a new way of writing applications that allowed developers to work in familiar environments and leave various decisions, which are often decided during the design phase, till later in the development cycle. Along with the Volta announcement Microsoft posted a version of the Volta infrastructure for people to start experimenting with. This is not an official CTP or beta, simply a way for people to get an early view of what Microsoft are looking at and to be able to provide feedback. The infrastructure requires Visual Studio 2008 and creates a number of new Volta project types.

1

The samples that shipped with the downloads are all web based and the technology that caught all the commentators eye was the ability to write the application in C# but then have post compilation rewrite the IL to JavaScript so the application ran as a true web application. On that basis Volta has been compared to Google Web Toolkit (GWT). However, Volta is much more than that and so this article attempts to explain the real power behind the Volta infrastructure.

IL Re-Writing
The real technology that Volta encapsulates is IL re-writing. In other words, taking the compiled assembly in IL form and using information in the assembly (in the form of attributes) rewriting the IL to provide extra functionality -functionality that the developer didn’t directly have to code themselves. The developer simply declares their “intention” and Volta writes the code.

The Volta team class their rewriting in three areas: repurposing, remodulating and refactoring.

Repurposing
This is the one that got all the attention; taking the IL and transforming it into something else for consumption by a different platform – in the sample case JavaScript and web applications. There is no reason, however, that the same approach could not be used to create Silverlight applications.

Remodulating
Generating code that is directed at a specific browser that takes advantage of its strengths rather than creating a least common denominator approach. This is probably the least interesting as the web controls in ASP.NET have in theory been able to do browser dependent rendering since ASP.NET’s inception.

Refactoring
Taking the application and changing the code to add new functionality or change the architecture of the existing application. This, I think, has by far the most potential for making a big impact on the development world. The Volta team showcased two examples of refactoring: Async and TierSplitting. We’ll now move on and look in more detail at these two refactors.

Async Refactoring
The Async rewriting allows a developer to write the synchronous version of a method and then declare a method signature for the asynchronous version and simply annotate that with the [Async] attribute. Volta then creates the asynchronous version of the code under the covers. For example, imagine we had a class whose job it was to take a generated log file and reformat it to, say, XML. For a large file this may be a time consuming task so it would be good to be able to run this asynchronously. However, it would be good to allow the developer to concentrate solely on the functionality of the log file rewrite and to leave the async details to Volta. Here is the code:

1

When rewriting the IL, the Volta compiler sees the [Async] attribute and generates the actual code for making the method asynchronous:

1

So what is this code actually doing? Well it creates a new object passing in a delegate wrapped around the synchronous version of the Reformat method and the callback. Then calls Invoke on the new object – let’s have a look at what Invoke does:

1

This should look pretty familiar to most .NET developers – it is simply calling the SynDelegate instance asynchronously passing a method called Handle to be called when the synchronous version completes. Let’s finally have a look at the Handle method:

1

Again this should look familiar. EndInvoke is called on the SynDelegate instance to get the result of the synchronous call and then the callback is fired passing this result.

So although Volta isn’t performing magic (the generated code is not hugely complex) it is allowing the developer to concentrate on the business problem at hand and just declare that they would like the operation to also support asynchronous execution. Volta takes care of providing the actual implementation of the asynchronous version.

TierSplitting
TierSplitting is a far more radical refactor than the async one. In this case you annotate types and the Volta compiler rewrites the IL into multi-tier application. The idea is that you concentrate on developing the functionality of the application and worry about deployment issues later in the development cycle. You decide on what classes to split by using the Refactor menu option:

11

This adds the RunAt attribute and sets up the project to run a test web server to host the server part of the application

1

Here "Server" is a reference to a url in the config file. For web applications there is another option attribute called [RunAtOrigin] which will run the server code on the web server from which the application was loaded.

How, then, does this actually work? Underneath the covers the Volta compiler creates a __TierSplit.aspx web page and this invokes the server code, storing server side application state in ASP.NET session in between server calls by building custom serializers for the server based state. All in all it looks very seamless. I do have some reservations about the current implementation of tiersplitting which, rather than spend more time repeating here I’ll just direct you to the blog posts, here and here, I made about them.

Conclusion
All in all I think Volta is a very exciting technology with some real potential benefits for developers. The more time developers can concentrate on solving the business problems rather than writing the plumbing the better. I also think Volta has to be seen for what it is at the moment – a technology preview. This is not a finished product but an idea with a bunch of implementations that are applicable to different scenarios – and I must admit some of those scenarios are very compelling. However, there is a long way to go before whatever Volta becomes is released. Now is a great time to pull down the bits and experiment with how you could conceptually use this technology. Send feedback to the team – this is, after all, why they announced the preview. We have a chance to influence the direction of a potentially very powerful technology.

To contact our CTO Richard Blewett, please send email to: richardb@develop.com

 

For more information email: onsites@develop.com or call 800.699.1932
 
Featured New Course


NEW- Essential Silverlight 2.0
April 23rd-25th in Los Angeles register online or call 800.699.19322


What you'll learn...
Learn to build Rich Internet Applications (RIAs) with Essential Silverlight. Microsoft Silverlight 2.0 takes advantage of the .NET platform to deliver online business applications, multimedia websites, and games on Windows, Mac OS, and Linux. It includes a scaled-down .NET runtime engine and library so you can create RIAs using languages and libraries that you already know. In this study, you will begin with a basic ASP.NET website, and use Silverlight to refine the application over several iterations.


You’ll get answers to these questions:
• How do I use the vector graphics in Silverlight to build compelling user interfaces?
• How can I integrate drag-and-drop and other dynamic custom controls?
• How can I use local files and external web services to store and retrieve data?
• How can I utilize background threads to make my UI more responsive?
• How does Silverlight compare to Flash, AJAX, and WPF?


Course Highlights
• Identify when and where Silverlight should be used
• Use Expression Blend to design your user interface
• Use Visual Studio 2008 to build a Silverlight project and the C# code-behind
• Incorporate Silverlight content into your existing Web sites
• Integrate animations, special effects and video to create a professional UI
• Accept input via mouse and keyboard in your application
• Consume web services and update UI dynamically
• Store data locally and reload it when the application runs again?
• Keep your applications responsive to user input while performing tasks
• Debug your Silverlight applications


Want to get a detailed course outline?
Click here
and put "Essential Silverlight 2.0" in the subject line.

 
NEW- .NET: MyTeam Custom Editions

We've developed 4 customizable .NET developer courses
based on the experience level of your team!

Start customizing your course today with a few simple answers. We'll recommend a custom edition that is designed for the experience level of your team. Then you can tailor the course to best support the application you're building.
Customize now: www.develop.com/myteam
 

Upcoming Guerrilla Events

What You Can Expect:

- Multiple instructors (2-5) per event

- Extended course hours
- A team of industry leading experts
- Leading-edge technologies
- Innovative course materials, including slides, labs, books, demos
- Your own PC and development platform
- Peer-to-peer collaboration and competition
- An exciting, multi-media learning environment


All Inclusive Price includes:
5-NIGHTS HOTEL, ALL MEALS AND BEVERAGES

ABOUT GUERRILLA EVENTS

To get a detailed course outline for any of the Guerrilla Events listed below, please send an email to requests@develop.com and put the course name in the subject line.

Featured Guerrilla Event

NEW- Guerrilla .NET: The Essentials - C
# and the .NET Platform
April 7th-11th in Los Angeles register online or call 800.699.1932

What you'll learn...
Guerrilla .NET: THE ESSENTIALS - C# and the .NET Platform is an intensive, hands-on course that reveals the concepts behind the technologies, and introduces techniques required to effectively build complete .NET applications using C#. This intensive five-day course covers what you need to know to develop .NET client and server applications that run on the Common Language Runtime (CLR), the core of the .NET platform which provides managed execution and type services for a variety of programming languages and system services.


Course Highlights
Our most thorough and fun tour of C# and the Microsoft .NET platform
Get a crash course in the C# language
See how the garbage collector works
Code a desktop GUI with Windows Forms
Code a desktop GUI with Windows Presentation Foundation (WPF)
Build a simple website using ASP.NET
Learn effective techniques for HTTP processing (Browser-based apps and Web Services)
Access your data using ADO.NET
Track down subtle bugs and memory issues with Visual Studio, WinDBG, and SOS.DLL
Building distributed services with the Windows Communication Foundation (WCF)
A team of World-class instructors renowned for development work and expertise
A variety of social activities to keep your energy and interest levels high all week


Want to get a detailed course outline?
CLICK HERE
and put "Guerrilla .NET: The Essentials" in the subject line.

back to top

 

Upcoming Courses

To get a detailed course outline for any of the courses listed below, please send an email to requests@develop.com and put the course name in the subject line.

Essential .NET register online or call 800.699.1932
March 3rd-7th in Los Angeles
March 17th-21st in New York


What you’ll learn…
Essential .NET is the best introduction to the .NET platform available today. Experienced C++, VB, or Java developers will find a rapid and enjoyable combination of .NET design philosophy and practical advice. You learn a myriad of patterns and best practices. You get hands-on experience with the major .NET 2.0 and .NET 3.0 class libraries, including Windows Forms, Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF), and ASP.NET.

NEW- Updated With .NET 3.5 Content -
Essential Windows Communication Foundation
register online or call 800.699.1932
February 26th-29th in Boston
March 17th-20th in Chicago
March 24th-27th in Orlando

WCF has been updated to reflect the changes and new features in .NET 3.5 including the new bindings and the Web Programming Model

Also:
- A new module concentrating solely on the design of service, data, message and fault contracts.
- A new module exploring the pure message based programming model including useful techniques like writing a SOAP router, more flexible version via custom dispatching and commonly used XML programming techniques like XmlReaders, XPath and Linq to XML.


What you’ll learn…
Learn to build secure and reliable WCF applications. Upon completion you will know how to define and access services using channels, bindings, messages, data contracts, operation contracts, and faults and know the built-in functionality of WCF, including instance management, concurrency, reliability, queues, transactions and security.

NEW- Updated With .NET 3.5 Content -
Essential Windows Presentation Foundation register online or call 800.699.1932
February 18th-22nd in Bellevue, WA
March 10th-14th in Los Angeles


What you’ll learn…
Essential Windows Presentation Foundation provides hands-on experience with the latest in Microsoft UI technologies. Come get familiar with the dynamic and creative application development that Windows Presentation Foundation (WPF) enables. Learn how to best utilize WPF for building new projects and for porting existing Windows Forms, Microsoft Foundation Class, or traditional Win32 applications over to this new platform. You get details on threading, utilizing 3D, globalization, and much more.

Essential ASP.NET register online or call 800.699.1932
March 17th-21st in Boston