Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

A .NET Developer's Insight into the Windows Runtime Library

The Windows Runtime Library is a native API for Windows 8 that is fundamental to Metro style applications.


advertisement

The Windows Runtime Library (WinRT) is the default API for the Windows 8 OS -- Microsoft's 128-bit OS with support for as much as 512 GB of RAM. Built on top of the Win32 API, the WinRT API provides a common platform for designing and developing applications (written in different languages) to execute using Metro style user interfaces in Windows 8.

WinRT essentially is an asynchronous COM-based API that provides an object-oriented runtime environment that sits on top of the Windows kernel (the operating system core that manages memory and other resources in the system). It wraps the Win32 API and extends it to provide support for Metro style applications. Application developers who work with .NET can seamlessly tap into WinRT because it exposes the WPF/Silverlight/XAML model. In turn, Metro style applications can leverage the benefits of hardware acceleration and advanced power management features out of the box. They run in a safe environment and can access all the underlying services of the system on which they are executed.

In the section that follows, I will dive into the Windows Runtime's design principles, its rich object model and the namespaces it contains.

WinRT Language Support

The major design principles of the WinRT API include support for responsiveness and an asynchronous nature. WinRT APIs are available through many languages like Visual Basic, Visual C#, Visual C++ and JavaScript, and it provides support for language-independent types like integer, enumerations, structures, arrays, interfaces, generic interfaces and runtime classes.



All you need to do is use XAML (Extensible Application Markup Language) markup code to design the user interface for your applications, use C#, VB.NET, or C++ to write the application logic, and then call the Windows Runtime appropriately.

You won't need to learn a new language to build Metro style applications with WinRT because it is comprised of a COM-based rich object model that is metadata driven and supports common programming constructs. Every Windows Runtime object implements the IUnknown interface. (Actually, all Windows Runtime components implement the IInspectable interface, which in turn derives from the IUnknown interface.)

The Windows Runtime Library provides a language-neutral type system and is exposed through API metadata in the form of .winmd files. Each of these files exposes one or more namespaces. The namespaces contain a collection of types (classes, structures and enumerations). You'll find the Windows Runtime library files inside the Windows Metadata folder in your system. The best part is that your .NET applications can directly reference Windows Runtime Library components as if they were simple .NET assemblies.

Here is the list of the namespaces that are contained in the Windows Runtime Library:

  • Windows.ApplicationModel
  • Windows.Data
  • Windows.Devices
  • Windows.Foundation
  • Windows.Globalization
  • Windows.Graphics
  • Windows.Management
  • Windows.Media
  • Windows.Networking
  • Windows.Security
  • Windows.Storage
  • Windows.System
  • Windows.UI
  • Windows.UI.Xaml
  • Windows.Web

Summary

The Windows Runtime Library is the Windows 32 API re-imagined for the Windows 8 operating system. It is a new COM-based API that provides support for developing Metro style applications seamlessly. In this article I discussed the WinRT features with special focus on its support for .NET developers to build Metro style applications.



   
Joydip Kanjilal has over 10 years of industry experience with C, C++, Java, C#, VB, VC++, ASP.Net, XML, Design Patterns, UML, etc. He currently works as a senior project leader in a reputable multinational company in Hyderabad, India, and has contributed articles on .NET and related technologies to www.aspalliance.com.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap