350 likes | 823 Views
PLAT-874T. Lap around the Windows Runtime. Martyn Lovell Development Manager, Windows Runtime Microsoft Corporation. Agenda. What is the Windows Runtime? Goals & Architecture Inside a Windows Metro style app JavaScript, C++, C# What are What are Windows Runtime Objects ?
E N D
PLAT-874T Lap around the Windows Runtime Martyn Lovell Development Manager, Windows Runtime Microsoft Corporation
Agenda • What is the Windows Runtime? • Goals & Architecture • Inside a Windows Metro style app • JavaScript, C++, C# • What are What are Windows Runtime Objects? • Classes, Interfaces and Patterns
Metro style application APIs User Interface HTML5/CSS XAML DirectX Controls Data Binding SVG Tiles Input Accessibility Printing Devices Communications & Data Web Contracts Geolocation Portable Sensors NFC Local & Cloud Storage Streams Notifications Media SMS Background Transfer XML Networking Visual Effects Playback Capture PlayTo Fundamentals Application Services Threading/Timers Memory Management Authentication Cryptography Globalization
Windows 8 Metro style Apps Desktop Apps HTML JavaScript HTML / CSS XAML View JavaScript (Chakra) C/C++ C#, VB Model Controller C C++ C# VB Windows Runtime APIs Devices & Printing Communication & Data Graphics & Media System Services .NET SL Internet Explorer Win32 Application Model Windows Kernel Services Kernel
The Windows Runtime is the solid, efficient foundation for building great Metro style apps
Windows Runtime Architecture Metro style app Language Support (CLR, WinJS, CRT) Language Projection Web Host (HTML, CSS, JavaScript)) Windows Metadata & Namespace UI Pickers Controls Media XAML Storage Network … Windows Runtime Core Runtime Broker Windows Core
The Windows 8 Developer Experience • Easy to build a Metro style app • Dramatic improvements in developer experience • Freedom of choice – language, library, markup
Major improvement to developer experience Great intellisense & tooling Responsive and Fluid Async APIs where they are needed App-Centric Platform Well managed app-to-app contracts Platform based Versioning Apps keep running on future Windows versions DesignPrinciples
demo Creating basic Metro style app HTML/JavaScript
Windows Runtime Architecture Metro style app Language Support (CLR, WinJS, CRT) Language Projection Web Host (HTML, CSS, JavaScript)) Windows Metadata & Namespace UI Pickers Controls Media XAML Storage Network … Windows Runtime Core Runtime Broker Windows Core
WindowsMetadata • Concise, complete description of the Windows Runtime • Generated natively from C++ or C#/VB Compiler • Efficient binary format derived CLI Metadata • Same structures, different meanings • Rich enough to allow multi-language projection generation • Full intellisense on statically known information
The Windows Namespace • Windows.* Runtime objects are in a simple, unified, hierarchical namespace • Great intellisense and browsing in Visual Studio • One Clear type for each function • Catalog is extensible but private • Your apps can add objects (in C++/C#) • Objects can be seen from JavaScript
demo Creating basic Metro style app C++ & C#
Windows Runtime Architecture Metro style app Language Support (CLR, WinJS, CRT) Language Projection Web Host (HTML, CSS, JavaScript)) Windows Metadata & Namespace UI Pickers Controls Media XAML Storage Network … Windows Runtime Core Runtime Broker Windows Core
What is a Windows Runtime Object? Shell32.dll IInspectable IUnknown IStorageItemInformation Object IStorageItem FileInformation Runtime Class IStorageFile Interfaces Windows Metadata (Disk) Activation Store (Registry)
Projections C++ App Projection IInspectable IUnknown Object C#/VB App CLR Projection HTML App Chakra Projection Windows Metadata
Versioning IInspectable IInspectable IUnknown IUnknown Future Windows Windows 8 Object Object Windows Metadata v8 App Windows Metadata v9 App Projection Projection
demo How patterns project Collections && Async
Windows Runtime Architecture Metro style app Language Support (CLR, WinJS, CRT) Language Projection Web Host (HTML, CSS, JavaScript)) Windows Metadata & Namespace UI Pickers Controls Media XAML Storage Network … Windows Runtime Core Runtime Broker Windows Core
Collections IInspectable C++ App STL-style Projection IUnknown IVector<T> Array IVectorView<T> C#/VB App IEnumerable (T) style Projection CLR IObservableVector<T> IInspectable HTML App JavaScript Projection Chakra IUnknown IMap<T> Associative Collection IMapView<T> IObservableMap<T>
Asynchronous Objects • Basic requirement for Metro style apps • Always responsive, ready • “Long running” APIs must be delivered as async • Simpler to allow apps to make synchronous calls • But then bad apps can overwhelm quality of system • Instead, build async into API shape • And have language projections integrate it deeply
Threading App Threadpool Main UI Thread Windows UI Object Windows Object Windows Object App Code App Code App Code
Three main types of object Thread bound – works only on the thread where it was created – most UI Thread flexible – works on any thread, uses locking if needed to control simultaneous access Brokered – out of process UI runs in single threaded environment that is not reentrant (“ Application STA”) Callbacks can only enter if they are related to an outgoing call Most non-UI runs in any thread WindowsRuntime Threading
Brokered Objects RuntimeBroker.exe App Proxy Projection IInspectable IUnknown Windows Runtime Object
Summary • The Windows Runtime is the solid, efficient foundation for the new Windows 8 developer platform • Build Metro style apps easily with the Windows Runtime • Windows available in your choice of language and environment • One Windows API, Natural and Familiar everywhere
Further reading and documentation • Other sessions with more drilldown • Windows Runtime internals: understanding "Hello World" (PLAT-875T) • Async everywhere: creating responsive APIs & apps (PLAT-203T) • Using the Windows Runtime from C++ (TOOL-532T) • Using the Windows Runtime from C# and Visual Basic (TOOL-531T) • Using the Windows Runtime from JavaScript (TOOL-533T) • Q&A at //build –WinRT folks at the Apps booth • I and other WinRT folks will be there today from 3-5, plus more. • Q&A online – http://forums.dev.windows.com
thank you Feedback and questions http://forums.dev.windows.com Session feedbackhttp://bldw.in/SessionFeedback
Great use of the template= a few tiny tweaks, but it looks very nice. Good luck in rehearsals today! -hannaha © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.