- Ruby, Rails, and scaling
- Visual WebGui: Easier, More Secure Web 2.0 Apps?
- Volta: How it Works
- Volta: Web Development by Tier-Splitting
- TODO: Notes to Myself
- Creating and Using a Data Access Layer with Visual Studio 2005
- Silverlight 101
- Free Lessons for Beginning .NET Programmers
- In Praise of ASP.NET
- Iron Python for ASP.NET
July 07, 2008 | Comments: (0)
I've seen several blogs and comments in news stories recently that boil down to the observation that programmers gravitate either to Python or Ruby for scripting, but not both. I guess I'm the exception that proves the rule: I've done Web templating projects using Python, and Web site projects using Ruby on Rails. For that matter, I've also done Web site projects in plain HTML, Perl, classic ASP and ASP.NET.
In my lab test of Rails IDEs I covered 9, count 'em 9 products. What was I thinking? I can't believe I did that. It was way more work than I'd planned on.
I started out proposing a review of Ruby in Steel Developer 1.2 on the strength of its unique Visual Rails Workbench, but reviewing that by itself didn't make sense to me. Then I thought I'd review Ruby in Steel against other Rails IDEs, but there turned out to be quite a few of those. And then I realized that I was leaving out TextMate and its clones. So, like Topsy, this review "just grow'd." I drew the line at editors that only know about Ruby and lack any Rails-specific features, but as I mentioned in the introduction to the article, you can make those work as well.
In Eric Knorr's Editor's Blog this week, he mentions the claims that Ruby on Rails scales poorly and lacks a security model. As far as I'm concerned, if good scaling and low latency are critical to your site, perhaps Rails isn't the right technology for you. On the other hand, Rails might be one of the fastest ways to develop a prototype site that you can throw away later. I wonder whether Twitter was supposed to be a throwaway prototype. But if that's the case, why haven't they rewritten the Twitter service so that it'll scale better?
Speaking of Ruby and scaling, Tim Bray knowingly used a naive Ruby script as the strawman benchmark for his Wide Finder 2 project. 78 lines of Ruby code analyzed 45 GB of Web logs in 25 hours. The strawman used only one of 32 possible hardware threads. If you look at the project results so far, you'll see scripts in Python, C++, Perl, Scala, Fan, Java, Groovy, OCaml, and gmake+sh+awk+C. The current champion is written in OCaml, a dialect of ML, and runs in 5 minutes using 31 worker threads.
Some of the speed difference certainly has to do with algorithms and threading. But some of the speed difference probably has to do with the slowness of the Ruby interpreter and libraries. If 5 minutes is roughly the I/O-bound time for this task using 31 worker threads, then a naive script running in one thread shouldn't take more than 160 minutes, or 2.67 hours. There's another factor of 9 to account for: is that because of Ruby?
Caveat coder.
Posted by Martin Heller on July 7, 2008 08:33 AM
January 24, 2008 | Comments: (0)
Visual WebGui: Easier, More Secure Web 2.0 Apps?
The basic goal of Web 2.0 applications is to provide the user experience of a desktop application on the Web. As we all know from using Ajax and RIA applications, it's possible to get fairly close. As developers who have built such applications know, it can be hard to get them right.
Visual WebGui, from Gizmox of Israel, attempts to make developing Web 2.0 applications just like developing Windows Forms applications. It's currently a free, open-source product built on top of ASP.NET on the server, with a DHTML presentation layer on the client. It uses an "empty client" model with a "gateway" channel to the server.
In December, Gizmox CTO Guy Peled posted a teaser blog entry entitled Visual WebGui Will Soon Support Silverlight as its Presentation Layer. Today, Gizmox dropped the other shoe with a press release and an alpha product rollout.
Gizmox is funded by venture capital. How are they going to make money (and a profit for the VCs) with a free open source product? According to the press release:
"Though Visual WebGui browser-based solution is and will remain a free, open-source platform, the company will generate revenue from development partnerships, premium enterprise dedicated controls and components, Silverlight extensions, enhanced scalability, plug-in support, customized development and a market place that will be a third party's (Visual WebGui's community developers) channel for their propriety development and other future added-value products and services," said Mr. Navot Peled, CEO, Visual WebGui. "We will announce the commercial version of Visual WebGui in April 2008."
To download Visual WebGui, you first need to register (free) on the site.
Posted by Martin Heller on January 24, 2008 06:00 AM
December 06, 2007 | Comments: (0)
I downloaded the Microsoft Volta preview bits yesterday after writing up my initial take on the announcement, only to discover that my Visual Studio 2008 Beta 2 Virtual PC had expired, meaning that I couldn't actually try Volta out myself.
Meanwhile, I looked into how Volta works. As documented here, Volta basically works as a recompiler for .NET 3.5 applications. As a developer, you build the whole application as though it will run entirely on the client, and then you mark parts of it to belong to the server tier. Compile it. Volta then looks at the generated MSIL in your assemblies, and rewrites it "into any number of target languages, including, today JavaScript and MSIL itself."
According to Microsoft, the three techniques used are "refactoring, retargeting, and remodulating. Refactoring converts single-tier code into distributed, concurrent code as directed by user-supplied annotations. Retargeting converts MSIL code into code for other virtual machines. Remodulating tailors a single piece of code for multiple browsers."
The fact that Volta can retarget .NET applications for JavaScript means that you can write plain old .NET code to generate Ajax applications, much in the same way as GWT lets you write plain old Java code to generate Ajax applications. That opens up a number of interesting scenarios.
It also opens up a number of interesting questions. How well will all of this work? Will it make developers' lives easier, or add yet another layer of junk between us and our goals, and introduce hard-to-debug, hard-to-profile black boxes into our applications? Will it turn out to be the powerful, liberating tool that Microsoft's write-up suggests, or will it turn out to primarily be a way to lock developers into writing for the .NET Framework?
What do you think? Have you been able to try Volta yourself?
Posted by Martin Heller on December 6, 2007 11:48 AM
December 05, 2007 | Comments: (0)
Volta: Web Development by Tier-Splitting
Microsoft Volta was just posted as a technology preview at Microsoft Live Labs. The short summary is that Volta is a new methodology for creating Web applications. Instead of deciding on your architecture at the beginning, building the tiers and tying them together, you start by building a .NET client application, then designate components to run on the server and client tiers later in the cycle, and let the tool generate the plumbing for you.
The tag line is "Web development using only the materials in the room." Why do I keep looking around for Heidi Klum and Tim Gunn?
Here's the full introduction from the Volta home page:
The Volta technology preview is a developer toolset that enables you to build multi-tier web applications by applying familiar techniques and patterns. First, design and build your application as a .NET client application, then assign the portions of the application to run on the server and the client tiers late in the development process. The compiler creates cross-browser JavaScript for the client tier, web services for the server tier, and communication, serialization, synchronization, security, and other boilerplate code to tie the tiers together.
Developers can target either web browsers or the CLR as clients and Volta handles the complexities of tier-splitting for you. Volta comprises tools such as end-to-end profiling to make architectural refactoring and optimization simple and quick. In effect, Volta offers a best-effort experience in multiple environments without any changes to the application.
Read Paul Krill's news article about Volta here, including discussions with the architects and product managers.
Posted by Martin Heller on December 5, 2007 11:13 AM
November 07, 2007 | Comments: (0)
- Update the rest of my Windows computers to the released version of Windows Live. (The upgrade went fine on this computer; I'm blogging with the released version of Windows Live Writer.)
- Look at the Infragistics Aikido CTP. This is a new Web User Interface Framework built using the Microsoft ASP.NET AJAX Framework and new controls, that makes the Web look a lot like the desktop, if the screen shots are to be believed.
- Compare the OpenSocial API with the Facebook API.
- Figure out whether there's a business model in OpenSocial and/or Facebook applications that makes sense for me or any of my clients.
- Try out the TI ez430-rf wireless embedded device SDK.
- Monday, November 12th: Look at the Android SDK release at http://www.openhandsetalliance.com/developers.html. How hard is it going to be to develop for the "Google Phone"?
- Early December: Build or buy a new desktop system for Visual Studio 2008 development.
Any suggestions from the peanut gallery?
Posted by Martin Heller on November 7, 2007 11:11 AM
October 18, 2007 | Comments: (0)
Creating and Using a Data Access Layer with Visual Studio 2005
Every time I do this I have to figure it out again. (Sometimes I empathize with HAL, when he is being dismantled at the end of 2001: "My mind is going, Dave. I can feel it.") I'm blogging this as much for myself as for anyone else it might help.
Here is the magic spell you need:
- Create a Class Library project in your solution in the supported language of your choice. I like C#, but Visual Basic .NET also works. I usually end the project name with DAL so that I can remember what it is.
- Delete the Class1.cs (or .vb) source file that is created automatically.
- Right-click on the project and add a new DataSet item. The design surface for an XSD file will open.
- Open a data connection to the database you're wrapping.
- Select each table you want to use and drag it to the design surface.
- Build the data access layer project.
- Add a reference to the data access layer project to your UI project. It doesn't really matter whether the UI project is a Windows Forms application, an ASP.NET application, a console application, or a Windows Presentation Foundation application.
- Add a using (or Imports) statement for the table adapters of the data access layer to your UI project. IntelliSense will help out if you added the reference properly.
Now you can instantiate the table adapters in your code and call the appropriate pre-generated methods for whatever CRUD operations you need. If you need other operations, you can go back to the DAL and add them: right click at the bottom of the table in the DataSet diagram and add a query.
Posted by Martin Heller on October 18, 2007 08:06 AM
May 01, 2007 | Comments: (0)

At Microsoft's MIX07 conference, the keynote was mostly about Silverlight. What is Silverlight, and why should we care about it?
Officially, Silverlight "is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web." In other words, it's a browser plug-in that enables a subset of the capabilities of the Windows Presentation Foundation over the Web. It was previously called WPF/E.
From the user's viewpoint, to enable Silverlight, you download and install a 1.4 MB plugin, and then you can view Silverlight content in IE, Firefox or Safari. From a developer's viewpoint, once you have the tools installed, you instantiate Silverlight by including some JavaScript helper files from your HTML, and then you can display and script XAML files in your Web pages.
Microsoft cites four key benefits of Silverlight:
1. Compelling cross-platform user experiences
2. Flexible Programming Model with Collaboration Tools
3. High-quality media, low-cost delivery
4. Connected to data, servers, and services
Two versions of Silverlight were announced Monday: the V1.0 beta, and the V1.1 Alpha. What's the difference? The diagram below summarizes what's in each release:
.png)
Again, why should we care? If you're a cynic, Silverlight just looks like Microsoft's answer to Flash. But if you like the idea of XAML-based display, or the idea of programming in managed code, then Silverlight offers a compelling model for programming the Web client.
Posted by Martin Heller on May 1, 2007 12:38 PM
March 12, 2007 | Comments: (0)
Free Lessons for Beginning .NET Programmers
When the free Express editions of Visual Studio were first announced, the Microsoft .NET Development Series got quite a few proposals for books aimed at amateur and novice programmers. As Series Editor, I always had to ask how much money someone would pay to learn how to use a free development environment. My gut feeling was "nothing:" the free IDEs would need free training, meaning that the business opportunity for Express-specific books was practically non-existent.
It has been a long time coming, but Microsoft now has a site for this, the Beginner Developer Learning Center. At first examination, I'm quite impressed.
The site is divided into two major tracks, one for Web development and one for Windows development. Within each track, there are lessons in each of three tiers. Tier 1 lessons assume no prior software development knowledge; tier 1 lessons assume that you understand the foundations of .NET development. Tier 3 lessons "expand your knowledge of Windows and Web development with more advanced concepts such as data access and debugging." (Pay no attention to the man behind the curtain rolling his eyes at this last statement.)
In addition, the Learning Center has a Kid's Corner with cartoony introductions to C#, VB, and Web development. I found these corny myself, but I haven't yet tried them out on my middle-school-aged kids.
For reference, the site has video "how-to" guides to Windows Forms and Web Forms controls in C# and Visual Basic, and a video "how-do-I" series about ASP.NET. Finally, it has a "Tips and Tricks" series of assorted video and PDF guides, for things like creating templates and deploying applications with ClickOnce.
These short video guides are very much in the same spirit as the short videos we produce here on InfoWorld.com. As with our videos, the production values might not be anything to write home about, but the information presented is right on the money.
Posted by Martin Heller on March 12, 2007 06:00 AM
February 28, 2007 | Comments: (0)
I'm working on a data-intensive Web site for a client, the kind of gig I can't really talk about except in general terms. Basically, we have extracted the non-proprietary information from thousands of detailed technology reports, and loaded them into a database. After conducting an extended internal test of a Web application I built to search the database, we're upgrading the interface and making the site available to subscribers.
When I started working on this project, ASP.NET 2.0 was still in beta test, and Ruby on Rails had just been released. As it happened, the client had Windows 2003 servers and SQL Server 2000, but using those servers wasn't a hard and fast requirement: they were willing to add Linux servers and MySQL if needed. In fact, we did another project later in 2006 using Ruby on Rails and MySQL, which was hosted at TextDrive.com.
However, we chose to implement this prototype site in ASP.NET 2.0 using standard Microsoft controls. I wrote any code needed in C#, but there was surprisingly little of it to write: most of the search display pages could be created using a SQL data source configured to plug a search parameter into the query string, and a GridView control bound to the data source. We got all sorts of functionality for free from the GridView control, including column sorting and row paging.
Drilldown pages used GridView, FormView, and DetailsView controls, also bound to SQL data sources. The only page that required a significant amount of code was the one that displayed a table constructed from multiple database records containing cell contents and locations: that page looped through a DataView row by row on page load, adding rows and cells to an ASP.NET Table object.
When I had questions, I consulted an early edition of what is now ASP.NET 2.0 Illustrated, by Alex Homer and Dave Sussman (Addison Wesley, 2006, 756 pp., $54.99, ISBN 0-321-41834-4). Usually, I found my answer in under five minutes. Full disclosure: at the time, I was editor of the Microsoft .NET Development Series, in which this book was published.
Now that I'm building a new version of the site, I'm taking advantage of what I learned from the first site, from Alex and Dave's book, and from my experience reviewing third-party ASP.NET controls for InfoWorld. This time around, I started by creating a master page with all the common headers and footers, and each actual page fits into the master.
I also chose to use the Infragistics Netadvantage WebGrid control for the new site. It has more sophisticated abilities than the standard Microsoft GridView, including the ability to group rows by the value of a column, filter by the value of a column, and automatically use Ajax to avoid some full-page callbacks to the server. I haven't quite gotten what I want out of it yet, but I'm sure it's there, because I have demos that do what I want: it'll take me a few more hours to find out exactly how to fit it all together.
Microsoft has always said that the power of its tools and technologies is multiplied by its robust "ecosystem" of ISV partners who produce additional tools and controls. I've got to say that, in my experience, it's true.
Am I saying that I'm against Open Source? Not at all. What I am saying is that well-designed, well-constructed commercial components can often pay for themselves very quickly in terms of developer productivity and time to market.
Posted by Martin Heller on February 28, 2007 06:00 AM
February 09, 2007 | Comments: (0)
I mentioned my affinity for Python on my first Weblog entry, at the end of last year. I had intended to tell you about the Iron Python for ASP.NET CTP in my second entry, but it mysteriously stopped working for me before I could write about it. It turns out that disabling Iron Python for ASP.NET was an unintended side effect of the Visual Studio SP1 installation, which also caused other mayhem on my Visual Studio 2005 instance. By the time I had fixed all that and reinstalled Iron Python for ASP.NET I was distracted by the AJAX subversion exploit.
I recently went back and looked at the Iron Python for ASP.NET CTP, and was impressed with what has actually been accomplished with that project. It's not just that you can code server-side ASP.NET Web logic very simply in Python, as in this Global.py from the Iron Python Personal Web site starter site:
from System import * from System.Web import * from System.Web.Security import * def Application_Start(): SiteMap.SiteMapResolve += AppendQueryString if not Roles.RoleExists('Administrators'): Roles.CreateRole('Administrators') if not Roles.RoleExists('Friends'): Roles.CreateRole('Friends') def AppendQueryString(sender, e): node = SiteMap.CurrentNode if node is not None: node = node.Clone(True) qs = e.Context.Request.QUERY_STRING if len(qs) > 0: node.Url += '?' + qs if node.ParentNode is not None: node.ParentNode.Url += '?' + qs return node
It's also not just that you can write code behind standard-looking ASP.NET pages in Python, and that much of what you already know about Python and ASP.NET just carries over.
No, it's even more impressive than that. What this team has done is to extend the ASP.NET model from static compiled languages to dynamic languages, as explained in David Ebbo's white paper on the subject. They basically scrapped the CodeDOM model used for static compiled languages, and extended the idea of no-compile pages. It sounds like a paradox, but they've created no-compile pages that support scripting languages with a change to the PageParserFilter API, which gives external code a hook into the parser. They have also added a custom HTTP module, and a custom base class for scripting pages.
One thing they haven't done is to support Web services. That turned out to be hard, and it's not clear when or even whether they'll come up with a solution. Another thing that they haven't done in the CTP, but which I hope to see in a future drop, is to write full Visual Studio IntelliSense support for Python. Stay tuned.
Posted by Martin Heller on February 9, 2007 06:00 AM
TOP STORIES
ADDITIONAL RESOURCES

- Application Grid: Oracle's Vision for Next-Generation Application Servers and Infrastructure
- Do you have the power to resolve technical issues with one call?
- Take control of your content- leverage Microsoft SharePoint

- PS Series Best Practices Deploying Microsoft(R) Exchange Server 2007 in an iSCSI SAN
- Building a Highly Reliable SAN
- Enhancing Your IT Environment with SnapShots


