Subscribe to Windows IT Pro
December 13, 2011 12:00 AM

Microsoft Windows 8, Metro, and WinRT: A New Era for Microsoft Platform Developers

Windows 8 expands .NET developers' world to encompass the Metro UI, WinRT, and HTML5
Dev Pro
InstantDoc ID #140949
Rating: (5)

The Microsoft BUILD conference of September 2011 has come and gone, and a new era of software development on the Microsoft platform has begun. It is fair to say that we are at the end of the decade of .NET and ushering in the era of Windows Runtime (WinRT). The change is exciting because WinRT is cool and powerful; the change is also scary because WinRT is new. Let me just say right up front that there is absolutely a place for .NET in this new era -- more on that point later.

And let me also set expectations right up front that this is not a "how-to" article by any stretch, nor is it designed to be. This article is intended to arm you with the strategic information you need to make informed decisions about the tools, plumbing, and platforms you will be building software on and with for the next many years on the Microsoft platform.

Sure, the secrecy leading up to the BUILD event helped generate the excitement. And we now know the rumors of .NET's death were exaggerated. I believe the WinRT announcement and its functionality described at the BUILD event are as significant as when .NET was announced in 2001. Only time will tell if I am right.

But First, A Bit About Metro

Bear with me if by the time you read this you are already "Metro'd to death." It's important to describe what Metro is because Microsoft is betting the farm on it. To me, Metro is a user interface (UI) made up of large tiles. It is designed specifically for touch, but it works just fine with a mouse and keyboard.

Metro was first fully unveiled on Windows Phone 7. But you can see glimpses of Metro in bits and pieces, such as typography, as early as Microsoft Encarta 95, and later as it evolved into products -- for example, Windows Media Center and Zune. Now, the Metro UI that ornaments the Windows Phone 7 will become the standard UI and user experience (UX) across the PC and phone as well as the upcoming Xbox 360 dashboard update.

The Industrial Designers Society of America (IDSA) awarded Windows Phone 7 the People's Choice Design gold award and the Best in Show award early in 2011. Isabel Ancona, who is the User Experience Consultant for IDSA, explained why the Metro UI on Windows Phone 7, shown in Figure 1, won this award:

"The innovation here is the fluidity of experience and focus on the data, without using traditional user interface conventions of windows and frames. Data becomes the visual elements and controls. Simple gestures and transitions guide the user deeper into content…. A truly elegant and unique experience."

140949_fig1_metro_ui
Figure 1: The Metro UI


We most certainly are not used to accolades of design like this awarded to Microsoft!

The Windows Runtime

So, let's try to define what WinRT is and what it is not. Here's Microsoft's definition: "WinRT consists of an execution interface as well as a collection of APIs that give access to the functionality provided by Windows 8." That Windows 8 part is important. Currently we can assume that WinRT will run only on Windows 8 and Windows Server 8.

"The WinRT application model was designed to make interfacing between languages and platforms easy and seamless." This is also important because as you'll learn in a second, this monster has many heads, and that is a good thing. But, I call Windows a platform, so I am guessing that Microsoft means HTML and native code are platforms. Because as stated previously, WinRT functions only on Windows 8.

So what are we to conclude from this definition, and why is WinRT different from the .NET Framework? Well, .NET as a framework is operating system agnostic. It runs on Windows 2000; it runs on Windows 7, and on every Microsoft OS in between. Technically, because of the open specification of the CLR, it could run almost anywhere including iOS, UNIX, and even on IBM mainframes. WinRT as a runtime is tied directly to the Windows OS it is running on. And in WinRT's case, it's tied to Windows 8.

Now, one of the decade-long critiques of .NET has been that what we gained in developer productivity with it we lost in performance because, as a framework, .NET is abstracted and wrapped to the point of hurting its performance when measured against native code (e.g., processor-specific, Win32, C++). Microsoft tells us that WinRT is much "closer to the metal" and promises to be lightning-quick when compared to .NET.

Now, Microsoft claims WinRT is a native runtime system that is implemented directly on the Windows NT kernel. However, a few sharp engineers who have looked under the hood have found that the WinRT runtime libraries are built upon the Win32 API. Since Window 8 and WinRT are not even in beta, I believe it is way too premature to do any whining about WinRT performance, but even so, the internals seem a bit odd because .NET uses exactly the same approach.

The Infamous Windows 8 Stack Diagram

Look carefully at the Windows 8 stack diagram in Figure 2. .NET lives in that tiny little corner at the bottom right.

140949_fig2_windows_8_platform
Figure 2: The Windows 8 platform


We have this stack diagram poster up on the wall in our lab at InterKnowlogy. As a joke, one of the engineers drew a tiny arrow to the bottom right corner and in tiny print wrote: "We live here." The reality is that we can live in both the green and the blue areas and intend to.

The green part of the stack diagram represents the Metro style of application development, which is native to Windows 8. But the tremendously great news is that Windows 8 has desktop mode (the blue part), and all your existing .NET apps will run in that mode. Perfect: It's the best of both worlds; your decade-long investment in .NET is not lost. Now, I have to admit that when I was briefed on Desktop mode months ago, I feared that you'd have to do a crazy keyboard combination like Windows+Shift+D to get from native Metro mode to Desktop mode and suffer a flicker and resync of the video driver, but thankfully, that is not the case at all. You switch back and forth from Desktop mode to Metro mode seamlessly, and the links to desktop mode apps actually exist in the Metro interface.

Notice that the screenshot in Figure 3 shows a Metro interface, but with a mix of tiles of Metro apps and Desktop apps.

140949_fig3_ui_metro_desktop_apps
Figure 3: Metro interface with both Metro and Desktop apps


The black tiles with the white stars in them are the little Metro app samples I built and compiled in Visual Studio 11. In fact, when I first got my hands on a pre-release Windows 8 tablet, I was absolutely shocked when all our existing .NET-based software installed and ran perfectly on it. The Windows Presentation Foundation (WPF) interactive kiosk product I'm involved in installed and ran perfectly. The kiosk app has a local service built in Windows Communication Foundation (WCF) that talks to a cloud back end. All our full 3D-based WPF apps installed and ran perfectly -- even our physical therapy demo that uses Kinect for a gesture-based interface. It all installed and ran perfectly.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.