ENTERPRISE

Windows 8 Architecture from a Developer’s Point of View : Understanding Windows Runtime (part 1) - Windows Runtime Architecture Overview

2/26/2014 2:46:30 AM

Without a doubt, Windows Runtime is the key component in the Windows 8 style application architecture. It represents a big leap in the evolution of the programming model, similar to what the .NET Framework did in 2002. The Microsoft team responsible for this great architectural piece describes Windows Runtime as “the solid, efficient foundation for building great Windows 8 style apps.”

The language run times utilized before .NET provide libraries that conceal most of the API operations, and expose a simpler set of objects and functions to make common programming tasks easier. The .NET Framework adds a runtime environment to these objects with extra features like garbage collection, exception handling, communication support between applications, and much more.

Although language runtime libraries and the .NET Framework have been continuously evolving for a long time, they still do not expose all data structures and operations proffered by the Win32 API. The main reason for this plight is that the runtime components utilizing Win32 are created separately from the services of the operating system.

This situation totally changed with Windows 8. Windows Runtime is an organic part of the operating system. It is not an additional component to be installed separately, such as the Windows Software Development Kit (Windows SDK). Every time a new Windows 8 build is created, the APIs and Windows Runtime are built together with the other parts of the operating system. Let’s take a closer look at the power of this great new component.

1. Windows Runtime Architecture Overview

Just as Windows 8 was designed with the user experience in mind, Windows Runtime was designed with a focus on the developer experience. Modern development environments such as Visual Studio provide great tooling to make developers more productive.

Windows Runtime Design Principles

A good example of a productive tool is IntelliSense, which watches the context as you are typing the code, and automatically offers a list of possible continuations. As shown the example in Figure 1, IntelliSense provides a list of expressions that may follow the this member in the context of the MainPage method. IntelliSense not only displays the list of appropriate members, but it also displays a short explanation of the selected member (AllowDrop) in a tooltip. The team responsible for the design of Windows Runtime continuously kept in mind that the new API should be very easy to use with powerful tools like IntelliSense.

Figure 1: IntelliSense makes developers more productive

c03f004.tif

The smooth user experience of Windows 8 can be delivered only by applications that keep the UI responsive. In the past, the biggest issues with Windows were bound to the lazy and rugged behavior of the operating system and its applications. For example, the user started to drag an object on the screen by moving the mouse fluently, but the object moved in a “bitty” fashion.

The asynchronous programming model provides a great remedy for this kind of issue. The model does not block the UI while performing long or resource-intensive computations in the background. The APIs of Windows Runtime were established with asynchrony in the mind. The design team made a tough decision: All operations that may take more than 50 milliseconds are implemented as asynchronous operations. The new versions of the C# and Visual Basic programming languages shipped with Visual Studio 2012 and support this programming model.

The Windows team has always invested a lot in providing backward application compatibility with every new Windows release. Windows Runtime is designed and established so that applications keep running in new Windows versions. If an API changes an operation in a new version of the operating system, the older operation versions still remain available in parallel with the new one, so they can be used side-by-side. Each application uses the version of the operation with which it was created.

The Building Blocks of Windows Runtime

Reflective of Microsoft’s design principles, Windows Runtime is not simply a set of APIs. It is a real runtime environment that binds the operating system services with the Windows 8 style applications built on them, independently of the programming language used to implement a particular application. This runtime environment is composed from several building blocks, as shown in Figure 2.

Figure 2: The building blocks of Windows Runtime

c03f005.eps

Windows OS are exposed to Windows 8 style applications through the Windows Runtime core block, which (as its name suggests) is the essence of the runtime environment. This core block wraps the low-level services into types and interfaces. On top of the core are many APIs, each of which is responsible for a certain kind of common operating system task. Although in Figure 2 only a few of them are shown, more than two dozen APIs are available.

You do not have to remember each type, interface, or even the API in which a certain type or functionality can be found, because Windows Runtime has its own metadata describing information about them. Moreover, the elemental types are grouped into hierarchical namespaces — such as objects in the .NET Framework, or in the Java Runtime — so it is quite easy to find them.


NOTE You learn more about Windows Runtime shortly.

Programming languages have different characteristics, and they use disparate conventions. At the top of the APIs and the metadata block, there is a thin layer, Language Projection, which is responsible for exposing the APIs in a language-specific way. Windows 8 style applications access Windows Runtime APIs through this layer.


A few other components shown in Figure 2 complete the environment where Windows 8 style applications can fully exploit the capabilities of the operating system through Windows Runtime:

  • Your application might access specific system resources (such as the webcam, the microphone, or the Internet) where the user’s permission is required. These resources can be accessed only through the Runtime Broker component that asks the user whether he or she allows the access to the resource — the first time an operation tries to use it. For example, if you create an application that picks up the user’s photo from the webcam, Runtime Broker does not let the system capture the photo unless the user explicitly enables it.
  • As you already learned, you can use HTML5 and JavaScript to create Windows 8 style applications. These apps — because of their web nature — run in a web host.
  • Each language has some specific runtime support (for example, runtime libraries that support the language, such as the printf C++ function, or append JavaScript method, or the String.Split operation available from C# and Visual Basic). These can be found in the Language Support building block that cooperates with the Language Projection layer.

Some of the building blocks shown in Figure 2 play an important role in everyday programming activities. In the next few sections, you learn more details about them.

Other  
  •  Windows 8 Architecture from a Developer’s Point of View : Windows 8 Development Architecture
  •  Windows 7 : Programming KMDF Hardware Driver - Mapping Resources - Code to Map Resources
  •  Windows 7 : Programming KMDF Hardware Driver - Handling Interrupts (part 2) - Deferred Processing for Interrupts
  •  Windows 7 : Programming KMDF Hardware Driver - Handling Interrupts (part 1) - Code for EvtInterruptIsr Callback
  •  Windows 7 : Programming KMDF Hardware Driver - Support Device Interrupts (part 2) - Post-Interrupt Enable and Pre-Interrupt Disable Processing
  •  Windows 7 : Programming KMDF Hardware Driver - Support Device Interrupts (part 1) - Creating an Interrupt Object,Enabling and Disabling Interrupts
  •  Microsoft Exchange Server 2010 : Managing Data and Database Availability Groups - Content Indexing
  •  Microsoft Exchange Server 2010 : Creating and Managing Database Availability Groups (part 5) - Switching over Servers and Databases
  •  Microsoft Exchange Server 2010 : Creating and Managing Database Availability Groups (part 4) - Configuring Database Availability Group Properties
  •  Microsoft Exchange Server 2010 : Creating and Managing Database Availability Groups (part 3) - Managing Database Availability Group Networks
  •  
    Video
    Video tutorials
    - How To Install Windows 8

    - How To Install Windows Server 2012

    - How To Install Windows Server 2012 On VirtualBox

    - How To Disable Windows 8 Metro UI

    - How To Install Windows Store Apps From Windows 8 Classic Desktop

    - How To Disable Windows Update in Windows 8

    - How To Disable Windows 8 Metro UI

    - How To Add Widgets To Windows 8 Lock Screen

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010
    programming4us programming4us
    Top 10
    Free Mobile And Desktop Apps For Accessing Restricted Websites
    MASERATI QUATTROPORTE; DIESEL : Lure of Italian limos
    TOYOTA CAMRY 2; 2.5 : Camry now more comely
    KIA SORENTO 2.2CRDi : Fuel-sipping slugger
    How To Setup, Password Protect & Encrypt Wireless Internet Connection
    Emulate And Run iPad Apps On Windows, Mac OS X & Linux With iPadian
    Backup & Restore Game Progress From Any Game With SaveGameProgress
    Generate A Facebook Timeline Cover Using A Free App
    New App for Women ‘Remix’ Offers Fashion Advice & Style Tips
    SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
    Popular Tags
    Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Exchange Server Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe Photoshop CorelDRAW X5 CorelDraw 10 windows Phone 7 windows Phone 8 Iphone