News Stay informed about the latest enterprise technology news and product updates.

Some of the Zen of Volta

Coming from Microsoft Labs and still in its early gestation, Volta is a methodology allowing developers to create apps without regard to eventual deployment, and to declaratively partition Web application elements across tiers.

In December 5th 2007 Microsoft announced an incubation project they have been working on called 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.

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.

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.

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.

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.

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.

This excerpted story comes courtesy of Developmentor which provides advanced training for professional software developers . To read the whole story, including code samples, go to The Zen of Volta.


Author Bio: Richard Blewett began life as a mainframe programmer writing ALGOL and COBOL, but jumped to OS/2 after a year. In 2000, he discovered .NET and has been living in the managed world ever since.He has worked on a number of high-profile projects, including being the middle-tier architect of the UK National Police Systems.

Dig Deeper on Dynamic .NET programming languages

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.