SlideShare a Scribd company logo
1 of 22
Windows 8 für .net Entwickler




Patric Boscolo
patbosc@microsoft.com
@patricsmsdn                    Student Technology Conference
Architecture
                                  Metro style apps                              Desktop apps
                                XAML                      HTML / CSS
 View




                         C                 C#              JavaScript
Controller
 Model




                        C++                VB               (Chakra)           HTML          C      C#
                                                                               JavaScript   C++     VB
                                       WinRT APIs
 System Services




                      Communication
                                       Graphics & Media   Devices & Printing
                         & Data
                                                                               Internet             .NET
                                      Application Model                                     Win32
                                                                               Explorer              / SL


                                      Windows Core OS Services
 Core
Sub- and Superset
   .NET Framework 4.5       Windows Phone 7




                                              Silverlight 5




   .NET Profile for Metro
        style apps
Windows             Managed
                                        Mapped Types         Interop Helpers
Runtime Types          Types


                                       Int32, String,        IBuffer / Byte[]
                  Tuple, List<T>,
99% of Windows*                        Boolean,              IAsync* / Task*
                  XDocument,
namespaces                             IEnumerable<T>,       InputStream, Output
                  DataContract, etc.
                                       IList<T>, Uri, etc.   Stream,
Design Requirements
• Remove APIs not applicable to Metro style apps
   –   e.g. Console, ASP.NET
• Remove dangerous, obsolete, and legacy APIs
• Remove duplication (within .NET APIs and with WRT APIs)
   –   e.g. ArrayList (with List<T>) and XML DOM (with WR XML API)
• Remove APIs that are OS API wrappers
   –   e.g. EventLog, Performance Counters
• Remove badly designed APIs
   –   e.g. APIs that are confusing, don’t follow basic design guidelines, cause bad dependencies
Compatibility Requirements
• Running existing .NET applications as-is on the .NET profile for
  Metro style apps is not an objective
• Porting existing C# and VB code to the profile should be easy
• Existing .NET developers should feel at home with this profile
• Code compiled to the profile must be able to execute on .NET
  Framework 4.5
• Code compiled to the portable subset needs to be compatible
  with this profile
* Refers to implementation assemblies, not reference assemblies. More on this later.
.NET for Metro style apps


WCF


XML                                    MEF


HTTP                               Serialization



                 BCL
Main Namespaces
System
System.Collections*
System.ComponentModel
System.ComponentModel.Composition*
System.Diagnostics*
System.Dynamic
System.Globalization
System.IO
System.Linq*
System.Net*
System.Reflection
System.Runtime.InteropServices*
System.Runtime.Serialization*
System.ServiceModel*
System.Text*
System.Threading
System.Threading.Tasks
System.Xml.*
System.Xml.Linq
Action
          System Namespace* Simplicity
                          GC                      SByte
Action<...>               Guid                    Single
Activator                 IAsyncResult            String
Array                     IComparable<T>          StringComparer
ArraySegment<T>           ICustomFormatter        StringComparison
AsyncCallback             IDisposable             StringSplitOptions
Attribute                 IEquatable<T>           ThreadStaticAttribute
AttributeTargets          IFormatProvider         TimeSpan
AttributeUsageAttribute   IFormattable            TimeZoneInfo
BitConverter              Int16                   Tuple
Boolean                   Int32                   Tuple<...>
Byte                      Int64                   Type
Char                      IntPtr                  TypedReference
CLSCompliantAttribute     IObservable<T>          UInt16
Convert                   IObserver<T>            UInt32
DateTime                  Lazy<T>                 UInt64
DateTimeKind              Math                    UIntPtr
DateTimeOffset            MidpointRounding        Uri
DayOfWeek                 MulticastDelegate       UriBuilder
Decimal                   Nullable                UriComponents
Delegate                  Nullable<T>             UriFormat
Double                    Object                  UriKind
Enum                      ObsoleteAttribute       ValueType
Environment               ParamArrayAttribute     Version
EventArgs                 Predicate<T>            Void
EventHandler              Random                  WeakReference
EventHandler<T>           RuntimeArgumentHandle   WeakReference<T>
Exception                 RuntimeFieldHandle
FlagsAttribute            RuntimeMethodHandle
Func<...>                 RuntimeTypeHandle




                                                                          * excluding exceptions
Removed, Replaced, and Changed
  –   System.Web
  –   System.Data
  –   System.Runtime.Remoting
  –   System.Reflection.Emit
  –   Private reflection
  –   Application Domains
Removed, Replaced, and Changed

Existing Technology               New Substitute
System.Windows                    Windows.UI.Xaml
System.Security.IsolatedStorage   Windows.Storage.ApplicationData
System.Resources                  Windows.ApplicationModel.Resources
System.Net.Sockets                Windows.Networking.Sockets
System.Net.WebClient              Windows.Networking.BackgroundTransfer and
                                  System.Net.HttpClient
Removed, Replaced, and Changed
Existing Technology   Changes
Serialization         •    Use Data Contract for general serialization needs
                      •    Use XML serialization for fine control of the XML
                           stream
Reflection            •   System.Type now represents a type reference
                      •   System.Reflection.TypeInfo is the new System.Type
XML                   •   XML Linq is the main XML parser
                      •   Use XmlReader/Writer as a low level abstraction
Collections           •   Non generic collections gone
                      •   New collection abstractions added:
                          IReadOnlyList<T>
Threading             •   Synchronization primitives mainly unchanged
                      •   Thread control in Windows.Foundation.Threading
                      •   Task.Run is the new high level way of doing
                          background processing
Async Model           •   !!!!
Porting Guide: Example Topic
Reflection
System.Type has become a type reference and only contains basic information. The majority of the reflection API's
are now on System.Reflection.TypeInfo. You can get a TypeInfo from a Type by using the GetTypeInfo() extension
method when you include a using statement for the System.Reflection namespace.
Existing .NET Code                            Replacement Code                            Notes
type.Assembly                                 type.GetTypeInfo().Assembly
type.GetMethods(BindingFlags.DeclaredOnly     type.GetTypeInfo().DeclaredMethods
)
type.GetMethod("MethodName",                  type.GetTypeInfo().GetDeclaredMethod("Met   These samples are the same for Properties,
BindingFlags.DeclaredOnly)                    hodName")                                   Events, and Fields.
type.GetMethod("MethodName")                  type.GetRuntimeMethod("MethodName")         GetRuntimeMethod API in Beta.
type.GetMethods()                             type.GetRuntimeMethods()                    GetRuntimeMethods() API in Beta.
type.GetMethods(BindingFlags.Instance|Bindi   type.GetRuntimeMethods().Where(m =>         GetRuntimeMethods() API in Beta.
ngFlags.Public)                               !m.IsStatic && m.IsPublic)
BindingFlags.NonPublic                        !member.IsPublic                            You can also use member.IsAssembly =>
                                                                                          internal or member.IsFamily => protected
                                                                                          for more flexibility
• .net 4.5 & Visual Studio 11
 Tools                  Programming Models
     Parallel                          C#/VB/F#
    Debugger             PLINQ          Async         Dataflow                                           Async           Parallel
                                                                                                                                     C++
         Stacks                                                                                          Agents          Pattern
                                                                                                                                     AMP
                                 Task Parallel Library                                                   Library         Library




                                                                  Data Structures

                                                                                    Data Structures
          Tasks

         Watch

   CPU            GPU
                                                                                                                                     Runtime
   Concurrency
                                  CLR ThreadPool                                                                  ConcRT
    Visualizer
   CPU            GPU               Task Scheduler                                                              Task Scheduler      DirectX
         Threads
                                  Resource Manager                                                         Resource Manager
         Cores



 Operating System                                                 Windows

                          Key:    Tooling   Managed      Native       New                             Updated
Async Implementation

• Task Representation as Feature in .net and Languages
  – Produce and Consume Async Operations

• When you write a Async Method
  – You Producing a Task<T> or Results Task<T>

• When you use Await
  – You await Task<T> or Results Task<T>
Mental Model
• We all “know” sync methods are “cheap”
   – Years of optimizations around sync methods
   – Enables refactoring at will
     public static void SimpleBody() {
       Console.WriteLine("Hello, Async World!");
     }

     .method public hidebysig static void SimpleBody() cil managed
     {
         .maxstack 8
         L_0000: ldstr "Hello, Async World!"
         L_0005: call void [mscorlib]System.Console::WriteLine(string)
         L_000a: ret
     }
Mental Model, cont.
                                       .method public hidebysig instance void MoveNext() cil managed
                                       {
                                         // Code size       66 (0x42)
                                         .maxstack 2
                                         .locals init ([0] bool '<>t__doFinallyBodies', [1] class [mscorlib]System.Exception '<>t__ex')



• Not so for asynchronous methods
                                         .try
                                         {
                                           IL_0000: ldc.i4.1
                                           IL_0001: stloc.0
                                           IL_0002: ldarg.0
                                           IL_0003: ldfld       int32 Program/'<SimpleBody>d__0'::'<>1__state'
                                           IL_0008: ldc.i4.m1
    public static async Task SimpleBody() { IL_000d
                                           IL_0009: bne.un.s
       Console.WriteLine("Hello, Async World!");
                                           IL_000b: leave.s     IL_0041
                                           IL_000d: ldstr       "Hello, Async World!"
    }                                      IL_0012: call        void [mscorlib]System.Console::WriteLine(string)
                                           IL_0017: leave.s     IL_002f
    .method public hidebysig static class} [mscorlib]System.Threading.Tasks.Task SimpleBody() cil managed
    {                                    catch [mscorlib]System.Exception
                                         {
      .custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
                                           IL_0019: stloc.1
      // Code size       32 (0x20)         IL_001a: ldarg.0
      .maxstack 2                          IL_001b: ldc.i4.m1
      .locals init ([0] valuetype Program/'<SimpleBody>d__0' V_0) Program/'<SimpleBody>d__0'::'<>1__state'
                                           IL_001c: stfld       int32
      IL_0000: ldloca.s    V_0             IL_0021: ldarg.0
      IL_0002: call                        IL_0022: ldflda      valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder
                           valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder
                                                                    Program/'<SimpleBody>d__0'::'<>t__builder'
                           [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Create()
                                           IL_0027: ldloc.1
      IL_0007: stfld       valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program/'<SimpleBody>d__0'::'<>t__builder'
                                           IL_0028: call        instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetException(
      IL_000c: ldloca.s    V_0                                      class [mscorlib]System.Exception)
      IL_000e: call        instance void Program/'<SimpleBody>d__0'::MoveNext()
                                           IL_002d: leave.s     IL_0041
      IL_0013: ldloca.s    V_0           }
      IL_0015: ldflda      valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program/'<SimpleBody>d__0'::'<>t__builder'
                                         IL_002f: ldarg.0
      IL_001a: call        instance classIL_0030: ldc.i4.m1
                                           [mscorlib]System.Threading.Tasks.Task
                                         IL_0031: stfld       int32 Program/'<SimpleBody>d__0'::'<>1__state'
    [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::get_Task()
                                         IL_0036: ldarg.0
      IL_001f: ret
                                         IL_0037: ldflda      valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder
    }                                                             Program/'<SimpleBody>d__0'::'<>t__builder'
                                         IL_003c: call        instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetResult()
                                         IL_0041: ret
                                       }
• Managed Profile Guided Optimization
  (for .net Applications)
• More Information

•   patbosc@microsoft.com
•   Twitter: @patricsmsdn
•   Blog: http://blogs.msdn.com/patricb

•   Search for:
•   ASYNC -> Stephen Toub
•   .GC -> Pracheeti Nagarkar
•   MPGO -> Mark Miller
•   .net -> BCL Team Blog & Krzysztof Cwalina, Immo Landwerth and Joshua Goodman
Windows 8 für .net Entwickler

More Related Content

What's hot

Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Alessandro Molina
 
Android architecture
Android architecture Android architecture
Android architecture Trong-An Bui
 
Dicoding Developer Coaching #30: Android | Mengenal Macam-Macam Software Desi...
Dicoding Developer Coaching #30: Android | Mengenal Macam-Macam Software Desi...Dicoding Developer Coaching #30: Android | Mengenal Macam-Macam Software Desi...
Dicoding Developer Coaching #30: Android | Mengenal Macam-Macam Software Desi...DicodingEvent
 
Tellurium 0.7.0 presentation
Tellurium 0.7.0 presentationTellurium 0.7.0 presentation
Tellurium 0.7.0 presentationJohn.Jian.Fang
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentRaman Pandey
 
Java AWT and Java FX
Java AWT and Java FXJava AWT and Java FX
Java AWT and Java FXpratikkadam78
 
Using Dagger in a Clean Architecture project
Using Dagger in a Clean Architecture projectUsing Dagger in a Clean Architecture project
Using Dagger in a Clean Architecture projectFabio Collini
 
Building Large Scale Javascript Application
Building Large Scale Javascript ApplicationBuilding Large Scale Javascript Application
Building Large Scale Javascript ApplicationAnis Ahmad
 
MobileConf 2015: Desmistificando o Phonegap (Cordova)
MobileConf 2015: Desmistificando o Phonegap (Cordova)MobileConf 2015: Desmistificando o Phonegap (Cordova)
MobileConf 2015: Desmistificando o Phonegap (Cordova)Loiane Groner
 
The Glass Class - Tutorial 3 - Android and GDK
The Glass Class - Tutorial 3 - Android and GDKThe Glass Class - Tutorial 3 - Android and GDK
The Glass Class - Tutorial 3 - Android and GDKGun Lee
 
JSF basics
JSF basicsJSF basics
JSF basicsairbo
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsHassan Abid
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & DependeciesÉdipo Souza
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介easychen
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Opersys inc.
 
Functional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersFunctional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersAurélien Pupier
 
Android Development
Android DevelopmentAndroid Development
Android Developmentmclougm4
 

What's hot (20)

Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
 
Android architecture
Android architecture Android architecture
Android architecture
 
Dicoding Developer Coaching #30: Android | Mengenal Macam-Macam Software Desi...
Dicoding Developer Coaching #30: Android | Mengenal Macam-Macam Software Desi...Dicoding Developer Coaching #30: Android | Mengenal Macam-Macam Software Desi...
Dicoding Developer Coaching #30: Android | Mengenal Macam-Macam Software Desi...
 
Ppt 2 android_basics
Ppt 2 android_basicsPpt 2 android_basics
Ppt 2 android_basics
 
Tellurium 0.7.0 presentation
Tellurium 0.7.0 presentationTellurium 0.7.0 presentation
Tellurium 0.7.0 presentation
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Java AWT and Java FX
Java AWT and Java FXJava AWT and Java FX
Java AWT and Java FX
 
Play framework
Play frameworkPlay framework
Play framework
 
Using Dagger in a Clean Architecture project
Using Dagger in a Clean Architecture projectUsing Dagger in a Clean Architecture project
Using Dagger in a Clean Architecture project
 
Building Large Scale Javascript Application
Building Large Scale Javascript ApplicationBuilding Large Scale Javascript Application
Building Large Scale Javascript Application
 
MobileConf 2015: Desmistificando o Phonegap (Cordova)
MobileConf 2015: Desmistificando o Phonegap (Cordova)MobileConf 2015: Desmistificando o Phonegap (Cordova)
MobileConf 2015: Desmistificando o Phonegap (Cordova)
 
The Glass Class - Tutorial 3 - Android and GDK
The Glass Class - Tutorial 3 - Android and GDKThe Glass Class - Tutorial 3 - Android and GDK
The Glass Class - Tutorial 3 - Android and GDK
 
JSF basics
JSF basicsJSF basics
JSF basics
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
 
Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013
 
Functional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and TestersFunctional Testing made easy with SWTBot for Developers and Testers
Functional Testing made easy with SWTBot for Developers and Testers
 
Android Development
Android DevelopmentAndroid Development
Android Development
 

Similar to Windows 8 für .net Entwickler

.Net Framework Introduction
.Net Framework Introduction.Net Framework Introduction
.Net Framework IntroductionAbhishek Sahu
 
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development Naresh Kumar
 
Introduction to dot net framework by vaishali sahare [katkar]
Introduction to dot net framework by vaishali sahare [katkar]Introduction to dot net framework by vaishali sahare [katkar]
Introduction to dot net framework by vaishali sahare [katkar]vaishalisahare123
 
NNUG Certification Presentation
NNUG Certification PresentationNNUG Certification Presentation
NNUG Certification PresentationNiall Merrigan
 
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep diveITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep diveITCamp
 
Whidbey old
Whidbey old Whidbey old
Whidbey old grenaud
 
.Net overviewrajnish
.Net overviewrajnish.Net overviewrajnish
.Net overviewrajnishRajnish Kalla
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...Maarten Balliauw
 
Windows 8 for .NET Developers
Windows 8 for .NET DevelopersWindows 8 for .NET Developers
Windows 8 for .NET DevelopersMichael Collins
 

Similar to Windows 8 für .net Entwickler (20)

.Net + novas tecnologias + win8
.Net + novas tecnologias + win8.Net + novas tecnologias + win8
.Net + novas tecnologias + win8
 
.Net Framework Introduction
.Net Framework Introduction.Net Framework Introduction
.Net Framework Introduction
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development
 
Introduction to dot net framework by vaishali sahare [katkar]
Introduction to dot net framework by vaishali sahare [katkar]Introduction to dot net framework by vaishali sahare [katkar]
Introduction to dot net framework by vaishali sahare [katkar]
 
NNUG Certification Presentation
NNUG Certification PresentationNNUG Certification Presentation
NNUG Certification Presentation
 
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep diveITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
 
.Net overviewrajnish
.Net overviewrajnish.Net overviewrajnish
.Net overviewrajnish
 
Introduction to Visual Studio.NET
Introduction to Visual Studio.NETIntroduction to Visual Studio.NET
Introduction to Visual Studio.NET
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
CFInterop
CFInteropCFInterop
CFInterop
 
1.Philosophy of .NET
1.Philosophy of .NET1.Philosophy of .NET
1.Philosophy of .NET
 
Revealing C# 5
Revealing C# 5Revealing C# 5
Revealing C# 5
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
Windows 8 for .NET Developers
Windows 8 for .NET DevelopersWindows 8 for .NET Developers
Windows 8 for .NET Developers
 

More from Patric Boscolo

Windows 8 App Developer Day
Windows 8 App Developer DayWindows 8 App Developer Day
Windows 8 App Developer DayPatric Boscolo
 
Visual Studio 2012 - Tipps & Tricks
Visual Studio 2012 - Tipps & TricksVisual Studio 2012 - Tipps & Tricks
Visual Studio 2012 - Tipps & TricksPatric Boscolo
 
Visual Studio 11 die neue IDE
Visual Studio 11 die neue IDEVisual Studio 11 die neue IDE
Visual Studio 11 die neue IDEPatric Boscolo
 
Gaming across multiple devices
Gaming across multiple devicesGaming across multiple devices
Gaming across multiple devicesPatric Boscolo
 
Mobile Web Presentation @ Multimedia Treff Köln
Mobile Web Presentation @ Multimedia Treff KölnMobile Web Presentation @ Multimedia Treff Köln
Mobile Web Presentation @ Multimedia Treff KölnPatric Boscolo
 
Eclipse & die Microsoft cloud
Eclipse & die Microsoft cloudEclipse & die Microsoft cloud
Eclipse & die Microsoft cloudPatric Boscolo
 
Wie skaliert man Software as a Service Applikationen in der Windows Azure Cloud
Wie skaliert man Software as a Service Applikationen in der Windows Azure CloudWie skaliert man Software as a Service Applikationen in der Windows Azure Cloud
Wie skaliert man Software as a Service Applikationen in der Windows Azure CloudPatric Boscolo
 

More from Patric Boscolo (10)

Spass mit Sensoren
Spass mit SensorenSpass mit Sensoren
Spass mit Sensoren
 
Erfolgsfaktor app!
Erfolgsfaktor app!Erfolgsfaktor app!
Erfolgsfaktor app!
 
Windows 8 App Developer Day
Windows 8 App Developer DayWindows 8 App Developer Day
Windows 8 App Developer Day
 
Visual Studio 2012 - Tipps & Tricks
Visual Studio 2012 - Tipps & TricksVisual Studio 2012 - Tipps & Tricks
Visual Studio 2012 - Tipps & Tricks
 
Visual Studio 11 die neue IDE
Visual Studio 11 die neue IDEVisual Studio 11 die neue IDE
Visual Studio 11 die neue IDE
 
Gaming across multiple devices
Gaming across multiple devicesGaming across multiple devices
Gaming across multiple devices
 
Mobile Web Presentation @ Multimedia Treff Köln
Mobile Web Presentation @ Multimedia Treff KölnMobile Web Presentation @ Multimedia Treff Köln
Mobile Web Presentation @ Multimedia Treff Köln
 
BizSpark goes Cloud
BizSpark goes CloudBizSpark goes Cloud
BizSpark goes Cloud
 
Eclipse & die Microsoft cloud
Eclipse & die Microsoft cloudEclipse & die Microsoft cloud
Eclipse & die Microsoft cloud
 
Wie skaliert man Software as a Service Applikationen in der Windows Azure Cloud
Wie skaliert man Software as a Service Applikationen in der Windows Azure CloudWie skaliert man Software as a Service Applikationen in der Windows Azure Cloud
Wie skaliert man Software as a Service Applikationen in der Windows Azure Cloud
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 

Windows 8 für .net Entwickler

  • 1. Windows 8 für .net Entwickler Patric Boscolo patbosc@microsoft.com @patricsmsdn Student Technology Conference
  • 2. Architecture Metro style apps Desktop apps XAML HTML / CSS View C C# JavaScript Controller Model C++ VB (Chakra) HTML C C# JavaScript C++ VB WinRT APIs System Services Communication Graphics & Media Devices & Printing & Data Internet .NET Application Model Win32 Explorer / SL Windows Core OS Services Core
  • 3.
  • 4. Sub- and Superset .NET Framework 4.5 Windows Phone 7 Silverlight 5 .NET Profile for Metro style apps
  • 5. Windows Managed Mapped Types Interop Helpers Runtime Types Types Int32, String, IBuffer / Byte[] Tuple, List<T>, 99% of Windows* Boolean, IAsync* / Task* XDocument, namespaces IEnumerable<T>, InputStream, Output DataContract, etc. IList<T>, Uri, etc. Stream,
  • 6. Design Requirements • Remove APIs not applicable to Metro style apps – e.g. Console, ASP.NET • Remove dangerous, obsolete, and legacy APIs • Remove duplication (within .NET APIs and with WRT APIs) – e.g. ArrayList (with List<T>) and XML DOM (with WR XML API) • Remove APIs that are OS API wrappers – e.g. EventLog, Performance Counters • Remove badly designed APIs – e.g. APIs that are confusing, don’t follow basic design guidelines, cause bad dependencies
  • 7. Compatibility Requirements • Running existing .NET applications as-is on the .NET profile for Metro style apps is not an objective • Porting existing C# and VB code to the profile should be easy • Existing .NET developers should feel at home with this profile • Code compiled to the profile must be able to execute on .NET Framework 4.5 • Code compiled to the portable subset needs to be compatible with this profile
  • 8. * Refers to implementation assemblies, not reference assemblies. More on this later.
  • 9. .NET for Metro style apps WCF XML MEF HTTP Serialization BCL
  • 11. Action System Namespace* Simplicity GC SByte Action<...> Guid Single Activator IAsyncResult String Array IComparable<T> StringComparer ArraySegment<T> ICustomFormatter StringComparison AsyncCallback IDisposable StringSplitOptions Attribute IEquatable<T> ThreadStaticAttribute AttributeTargets IFormatProvider TimeSpan AttributeUsageAttribute IFormattable TimeZoneInfo BitConverter Int16 Tuple Boolean Int32 Tuple<...> Byte Int64 Type Char IntPtr TypedReference CLSCompliantAttribute IObservable<T> UInt16 Convert IObserver<T> UInt32 DateTime Lazy<T> UInt64 DateTimeKind Math UIntPtr DateTimeOffset MidpointRounding Uri DayOfWeek MulticastDelegate UriBuilder Decimal Nullable UriComponents Delegate Nullable<T> UriFormat Double Object UriKind Enum ObsoleteAttribute ValueType Environment ParamArrayAttribute Version EventArgs Predicate<T> Void EventHandler Random WeakReference EventHandler<T> RuntimeArgumentHandle WeakReference<T> Exception RuntimeFieldHandle FlagsAttribute RuntimeMethodHandle Func<...> RuntimeTypeHandle * excluding exceptions
  • 12. Removed, Replaced, and Changed – System.Web – System.Data – System.Runtime.Remoting – System.Reflection.Emit – Private reflection – Application Domains
  • 13. Removed, Replaced, and Changed Existing Technology New Substitute System.Windows Windows.UI.Xaml System.Security.IsolatedStorage Windows.Storage.ApplicationData System.Resources Windows.ApplicationModel.Resources System.Net.Sockets Windows.Networking.Sockets System.Net.WebClient Windows.Networking.BackgroundTransfer and System.Net.HttpClient
  • 14. Removed, Replaced, and Changed Existing Technology Changes Serialization • Use Data Contract for general serialization needs • Use XML serialization for fine control of the XML stream Reflection • System.Type now represents a type reference • System.Reflection.TypeInfo is the new System.Type XML • XML Linq is the main XML parser • Use XmlReader/Writer as a low level abstraction Collections • Non generic collections gone • New collection abstractions added: IReadOnlyList<T> Threading • Synchronization primitives mainly unchanged • Thread control in Windows.Foundation.Threading • Task.Run is the new high level way of doing background processing Async Model • !!!!
  • 15. Porting Guide: Example Topic Reflection System.Type has become a type reference and only contains basic information. The majority of the reflection API's are now on System.Reflection.TypeInfo. You can get a TypeInfo from a Type by using the GetTypeInfo() extension method when you include a using statement for the System.Reflection namespace. Existing .NET Code Replacement Code Notes type.Assembly type.GetTypeInfo().Assembly type.GetMethods(BindingFlags.DeclaredOnly type.GetTypeInfo().DeclaredMethods ) type.GetMethod("MethodName", type.GetTypeInfo().GetDeclaredMethod("Met These samples are the same for Properties, BindingFlags.DeclaredOnly) hodName") Events, and Fields. type.GetMethod("MethodName") type.GetRuntimeMethod("MethodName") GetRuntimeMethod API in Beta. type.GetMethods() type.GetRuntimeMethods() GetRuntimeMethods() API in Beta. type.GetMethods(BindingFlags.Instance|Bindi type.GetRuntimeMethods().Where(m => GetRuntimeMethods() API in Beta. ngFlags.Public) !m.IsStatic && m.IsPublic) BindingFlags.NonPublic !member.IsPublic You can also use member.IsAssembly => internal or member.IsFamily => protected for more flexibility
  • 16. • .net 4.5 & Visual Studio 11 Tools Programming Models Parallel C#/VB/F# Debugger PLINQ Async Dataflow Async Parallel C++ Stacks Agents Pattern AMP Task Parallel Library Library Library Data Structures Data Structures Tasks Watch CPU GPU Runtime Concurrency CLR ThreadPool ConcRT Visualizer CPU GPU Task Scheduler Task Scheduler DirectX Threads Resource Manager Resource Manager Cores Operating System Windows Key: Tooling Managed Native New Updated
  • 17. Async Implementation • Task Representation as Feature in .net and Languages – Produce and Consume Async Operations • When you write a Async Method – You Producing a Task<T> or Results Task<T> • When you use Await – You await Task<T> or Results Task<T>
  • 18. Mental Model • We all “know” sync methods are “cheap” – Years of optimizations around sync methods – Enables refactoring at will public static void SimpleBody() { Console.WriteLine("Hello, Async World!"); } .method public hidebysig static void SimpleBody() cil managed { .maxstack 8 L_0000: ldstr "Hello, Async World!" L_0005: call void [mscorlib]System.Console::WriteLine(string) L_000a: ret }
  • 19. Mental Model, cont. .method public hidebysig instance void MoveNext() cil managed { // Code size 66 (0x42) .maxstack 2 .locals init ([0] bool '<>t__doFinallyBodies', [1] class [mscorlib]System.Exception '<>t__ex') • Not so for asynchronous methods .try { IL_0000: ldc.i4.1 IL_0001: stloc.0 IL_0002: ldarg.0 IL_0003: ldfld int32 Program/'<SimpleBody>d__0'::'<>1__state' IL_0008: ldc.i4.m1 public static async Task SimpleBody() { IL_000d IL_0009: bne.un.s Console.WriteLine("Hello, Async World!"); IL_000b: leave.s IL_0041 IL_000d: ldstr "Hello, Async World!" } IL_0012: call void [mscorlib]System.Console::WriteLine(string) IL_0017: leave.s IL_002f .method public hidebysig static class} [mscorlib]System.Threading.Tasks.Task SimpleBody() cil managed { catch [mscorlib]System.Exception { .custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 ) IL_0019: stloc.1 // Code size 32 (0x20) IL_001a: ldarg.0 .maxstack 2 IL_001b: ldc.i4.m1 .locals init ([0] valuetype Program/'<SimpleBody>d__0' V_0) Program/'<SimpleBody>d__0'::'<>1__state' IL_001c: stfld int32 IL_0000: ldloca.s V_0 IL_0021: ldarg.0 IL_0002: call IL_0022: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program/'<SimpleBody>d__0'::'<>t__builder' [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Create() IL_0027: ldloc.1 IL_0007: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program/'<SimpleBody>d__0'::'<>t__builder' IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetException( IL_000c: ldloca.s V_0 class [mscorlib]System.Exception) IL_000e: call instance void Program/'<SimpleBody>d__0'::MoveNext() IL_002d: leave.s IL_0041 IL_0013: ldloca.s V_0 } IL_0015: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder Program/'<SimpleBody>d__0'::'<>t__builder' IL_002f: ldarg.0 IL_001a: call instance classIL_0030: ldc.i4.m1 [mscorlib]System.Threading.Tasks.Task IL_0031: stfld int32 Program/'<SimpleBody>d__0'::'<>1__state' [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::get_Task() IL_0036: ldarg.0 IL_001f: ret IL_0037: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder } Program/'<SimpleBody>d__0'::'<>t__builder' IL_003c: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetResult() IL_0041: ret }
  • 20. • Managed Profile Guided Optimization (for .net Applications)
  • 21. • More Information • patbosc@microsoft.com • Twitter: @patricsmsdn • Blog: http://blogs.msdn.com/patricb • Search for: • ASYNC -> Stephen Toub • .GC -> Pracheeti Nagarkar • MPGO -> Mark Miller • .net -> BCL Team Blog & Krzysztof Cwalina, Immo Landwerth and Joshua Goodman