User Interface
 HTML5/CSS                        XAML                         DirectX                     Controls             Data Binding

     SVG                             Tiles                      Input                  Accessibility              Printing



                Devices                                                  Communications & Data
Geolocation      Portable      Sensors          NFC          Contracts         Local & Cloud Storage               Web


                                                                           Notifications              Streams
                 Media
                                             Visual         Background
Playback      Capture       PlayTo                                             XML               Networking        SMS
                                             Effects          Transfer



                                                        Fundamentals
Application Services        Threading/Timers           Memory Management    Authentication       Cryptography   Globalization
Metro style Apps                        Desktop Apps
  View




                              XAML                      HTML / CSS
Controller




                                                        JavaScript
 Model




                      C/C++           C#, VB                          HTML         C      C#
                                                         (Chakra)     JavaScrip   C++     VB
                                                                          t
                              Windows Runtime APIs
  System Services




                    Communication      Graphics &         Devices &
                       & Data            Media             Printing

                                    Application Model                 Internet            .NET
                                                                      Explorer
                                                                                  Win32    SL
Kern




                                       Windows Kernel Services
 el
Metro style app
                                                       Language Support
                                                      (CLR, WinJS, CRT)
             Language Projection

               UI       Pickers    Controls   Media
                                                      Web Host (HTML,
                                                      CSS, JavaScript))
 Windows      XAML      Storage    Network     …
Metadata &
Namespace
                     Windows Runtime Core              Runtime Broker


                          Windows Core
Demo
Metro style app
                                                       Language Support
                                                      (CLR, WinJS, CRT)
             Language Projection

               UI       Pickers    Controls   Media
                                                      Web Host (HTML,
                                                      CSS, JavaScript))
 Windows      XAML      Storage    Network     …
Metadata &
Namespace
                     Windows Runtime Core              Runtime Broker


                          Windows Core
Strings              HSTRING                          Avoids copying in multiple languages

Basic Types          INT32, UINT64 *                  Pointers allowed in limited cases

Enumerations         enum AsyncStatus                 Flag or non-flag styles

Structures           struct Rect;                     Can contain strings, but not interfaces

Simple Arrays        INT32 []                         For very basic collections

Interfaces           IInspectable                     Methods are defined in interfaces

Generic Interfaces   IVector<T>                       Type-generic interface

Runtime Class        Windows.Storage.StorageFile Binds interfaces to make a class
Demo
Metro style app
                                                        Language Support
                                                       (CLR, WinJS, CRT)
             Language Projection
              Language Projection

                UI       Pickers    Controls   Media       Web Host
                                                       (HTML, CSS, JavaS
 Windows       XAML      Storage    Network     …            cript))
Metadata &
Namespace
                      Windows Runtime Core              Runtime Broker


                           Windows Core
IInspectable                    Shell32.dll


        IUnknown
                              IStorageItemInformation
                              IStorageItem                      FileInformation
         Object               IStorageFile

                              Interfaces                        Runtime Class

Activation Store (Registry)                  Windows Metadata (Disk)
IInspectable                                   C++ App




                          Projectio
                              n
    IUnknown
                                                    C#/VB App




                          Projectio

                                      CLR
                              n
  Object
                                                    HTML App




                          Projectio

                                      Chakra
                              n
               Windows
               Metadata
Projection creates
                       IInspectable
      Start                               wrapper (using
                         returned
                                             metadata)                App




                     Object created by                             Projection
App asks to create                       Object bound to
                     implementation
     object                                 wrapper
                           code



                                                              WinRT Object Manager
  Pass Name to          Call DllGet-     Wrapper returned
RoActivateInstance   ActivationFactory       to App




  Find DLL using                                                  WinRT Object
                         Load DLL               End
     Catalog
IInspectable                       IInspectable
       IUnknown                           IUnknown


        Object                             Object
                 Projectio




                                                    Projectio
 Windows                     App    Windows                     App
                     n




                                                        n
Metadata v8                        Metadata v9
Demo
Collections       IVector<T>, IVectorView<T>,         Iterators, Collections and events
                  IMap<T>                             cross-language

Delegates         delegate                            Encapsulate the context to call
                  AsyncActionCompletedHandler         back to an object

Events            IApplicationLayout::LayoutChanged   Lists of callback recipients


PropertySet       interface IPropertySet              Collection of items with varying
                                                      types

Async Interface   ReceivePropertiesOperation          A way to get a delayed result
                                                      without blocking

Contracts         Windows.ApplicationModel.           Connect Apps to Windows
                  DataTransferManager                 Extension Points
C++ App
              STL-style
              Projection



  Array       IEnumerabl                 C#/VB App




                            CLR
                    e
                (T) style
               Projection

                                         HTML App




                            Chakra
              JavaScript
              Projection

Associative
Collection
var         new CameraCaptureUI
                                         new Size

var           await                     CameraCaptureUIMode

if

      var             new BitmapImage
                          await              FileAccessMode
DllImport "avicap32.dll"            "capCreateCaptureWindow"
static extern int
  string                  int
  int    int    int           int
  int             int

 DllImport "avicap32.dll"
static extern bool
  int
   MarshalAs UnmanagedType          ref string
  int
   MarshalAs UnmanagedType          ref string
  int

// more and more of the same
Demo
App
Main UI Thread                    Threadpool




 Windows
                 Windows                       Windows
    UI
                  Object                        Object
  Object




   App Code            App Code                      App Code
Projection
                                                App




                           Proxy
       RuntimeBroker.exe

IInspectable
    IUnknown


  Windows
Runtime Object
Introducing Windows Runtime in Windows 8
Introducing Windows Runtime in Windows 8
Introducing Windows Runtime in Windows 8

Introducing Windows Runtime in Windows 8

  • 5.
    User Interface HTML5/CSS XAML DirectX Controls Data Binding SVG Tiles Input Accessibility Printing Devices Communications & Data Geolocation Portable Sensors NFC Contracts Local & Cloud Storage Web Notifications Streams Media Visual Background Playback Capture PlayTo XML Networking SMS Effects Transfer Fundamentals Application Services Threading/Timers Memory Management Authentication Cryptography Globalization
  • 6.
    Metro style Apps Desktop Apps View XAML HTML / CSS Controller JavaScript Model C/C++ C#, VB HTML C C# (Chakra) JavaScrip C++ VB t Windows Runtime APIs System Services Communication Graphics & Devices & & Data Media Printing Application Model Internet .NET Explorer Win32 SL Kern Windows Kernel Services el
  • 8.
    Metro style app Language Support (CLR, WinJS, CRT) Language Projection UI Pickers Controls Media Web Host (HTML, CSS, JavaScript)) Windows XAML Storage Network … Metadata & Namespace Windows Runtime Core Runtime Broker Windows Core
  • 11.
  • 13.
    Metro style app Language Support (CLR, WinJS, CRT) Language Projection UI Pickers Controls Media Web Host (HTML, CSS, JavaScript)) Windows XAML Storage Network … Metadata & Namespace Windows Runtime Core Runtime Broker Windows Core
  • 16.
    Strings HSTRING Avoids copying in multiple languages Basic Types INT32, UINT64 * Pointers allowed in limited cases Enumerations enum AsyncStatus Flag or non-flag styles Structures struct Rect; Can contain strings, but not interfaces Simple Arrays INT32 [] For very basic collections Interfaces IInspectable Methods are defined in interfaces Generic Interfaces IVector<T> Type-generic interface Runtime Class Windows.Storage.StorageFile Binds interfaces to make a class
  • 17.
  • 19.
    Metro style app Language Support (CLR, WinJS, CRT) Language Projection Language Projection UI Pickers Controls Media Web Host (HTML, CSS, JavaS Windows XAML Storage Network … cript)) Metadata & Namespace Windows Runtime Core Runtime Broker Windows Core
  • 20.
    IInspectable Shell32.dll IUnknown IStorageItemInformation IStorageItem FileInformation Object IStorageFile Interfaces Runtime Class Activation Store (Registry) Windows Metadata (Disk)
  • 21.
    IInspectable C++ App Projectio n IUnknown C#/VB App Projectio CLR n Object HTML App Projectio Chakra n Windows Metadata
  • 22.
    Projection creates IInspectable Start wrapper (using returned metadata) App Object created by Projection App asks to create Object bound to implementation object wrapper code WinRT Object Manager Pass Name to Call DllGet- Wrapper returned RoActivateInstance ActivationFactory to App Find DLL using WinRT Object Load DLL End Catalog
  • 23.
    IInspectable IInspectable IUnknown IUnknown Object Object Projectio Projectio Windows App Windows App n n Metadata v8 Metadata v9
  • 24.
  • 25.
    Collections IVector<T>, IVectorView<T>, Iterators, Collections and events IMap<T> cross-language Delegates delegate Encapsulate the context to call AsyncActionCompletedHandler back to an object Events IApplicationLayout::LayoutChanged Lists of callback recipients PropertySet interface IPropertySet Collection of items with varying types Async Interface ReceivePropertiesOperation A way to get a delayed result without blocking Contracts Windows.ApplicationModel. Connect Apps to Windows DataTransferManager Extension Points
  • 26.
    C++ App STL-style Projection Array IEnumerabl C#/VB App CLR e (T) style Projection HTML App Chakra JavaScript Projection Associative Collection
  • 28.
    var new CameraCaptureUI new Size var await CameraCaptureUIMode if var new BitmapImage await FileAccessMode
  • 29.
    DllImport "avicap32.dll" "capCreateCaptureWindow" static extern int string int int int int int int int DllImport "avicap32.dll" static extern bool int MarshalAs UnmanagedType ref string int MarshalAs UnmanagedType ref string int // more and more of the same
  • 30.
  • 31.
    App Main UI Thread Threadpool Windows Windows Windows UI Object Object Object App Code App Code App Code
  • 33.
    Projection App Proxy RuntimeBroker.exe IInspectable IUnknown Windows Runtime Object

Editor's Notes

  • #12 varfpd = new Windows.Storage.Pickers.FileOpenPicker();fpd.fileTypeFilter.push(“.jpg”);fpd.fileTypeFilter.push(“.png”);fpd.pickSingleFileAsync().then(function (f) {img.src = window.URL.createObjectURL(f, false);});
  • #15 Rich metadata – compare to windows.h; no relation between APIs
  • #16 Private catalog – sharing between apps only through OS contracts
  • #17 Thin projection layer for performance  HSTRING storyInterface-based system; also for versioning; don’t want to say it day-to-day, so we got runtime classes (may evolve) = collection of functionality (can grow) based on a set of interfacesAlso generic interfaces, e.g. for vectors (type-safety for collections)
  • #21 Don’t have to see the interfaces for regular purposes
  • #22 C++ @ compile time, native code talks directly to the OS, no metadata read at runtimeC#/VB – mixture of metadata at runtime and compile time; RCWs generated by CLRJS – using metadata at runtime (dynamic language)
  • #23 App doesn’t have to know much – everything happens behind the scenes (projection, WinRT)
  • #24 Interface tied back to version of WindowsNew version of a class may have more interfacesTools can surface only the interfaces that are available in targeted OS versions for the app
  • #28 Responsive, fluid platform
  • #30 Not straightforward; P/Invoke, COM interop; rocket science
  • #32 Compare to JS (apart from web workers), single-threaded environmentWork is done in background thread and in async operations
  • #34 E.g. webcam promptSame for pickersConfidence for the user
  • #35 API set, but also coreInterface-basedProjectionsUnderpins whole Windows platformThis level of detail is not needed to use it (debugging, etc.)One Windows API for each thingNatural and familiar in your language