SlideShare une entreprise Scribd logo
1  sur  20
Portable Class Library: Tomorrow's Apps Today




                            Jeremy Likness (@JeremyLikness)
                            Principal Consultant
                            jlikness@wintellect.com
                                                                Copyright © 2012




consulting   training   design   debugging                    wintellect.com
what we do
    consulting     training    design     debugging

 who we are
   Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins –
   we pull out all the stops to help our customers achieve their goals through advanced
   software-based consulting and training solutions.

 how we do it                                           Training
                                                        •   On-site instructor-led training
   Consulting & Debugging                               •   Virtual instructor-led training
   •   Architecture, analysis, and design services      •   Devscovery conferences
   •   Full lifecycle custom software development
   •   Content creation                                 Design
   •   Project management                               •   User Experience Design
   •   Debugging & performance tuning                   •   Visual & Content Design
                                                        •   Video & Animation Production


consulting    training    design     debugging                                   wintellect.com
Building Windows 8 Apps with C#
                                   • http://bit.ly/win8design
                                   • Free source at:
                                      http://windows8applications.codeplex.com/
                                   • Everything you need to build and
                                     deploy Windows Store apps
                                     using C# and XAML
                                   • Includes the portable project you
                                     will see today




consulting   training   design   debugging                          wintellect.com
Agenda
 •   Introduction to the Portable Class Library
 •   Understanding Extension SDKs
 •   Portable profiles
 •   Chasing ICommand: PCL Under the Hood
 •   Porting existing code
 •   Strategies for building new applications
 •   Comprehensive Example: Wintellog
 •   PCL Futures




consulting   training   design   debugging        wintellect.com
Introducing PCL
 • Write and build managed assemblies that work (without
   recompiling) on more than one .NET Framework platform
 • Target frameworks include:
      –   .NET Framework 4 and later (including WPF)
      –   .NET for Windows Store apps (Windows 8)
      –   Silverlight 4 and later
      –   Windows Phone 7 and later
      –   Xbox 360
 • Eliminate sharing of source




consulting   training   design   debugging             wintellect.com
Supported Features
   Feature             .NET           Windows     Silverlight   Windows   Xbox 360
                       Framework      Store                     Phone
   Core                Yes            Yes         Yes           Yes       Yes
   XLINQ               4.0.3+         Yes         Yes           Yes       Yes
   LINQ                Yes            Yes         Yes           Yes
   Network             Yes            Yes         Yes           Yes
   Serialization       Yes            Yes         Yes           Yes
   WCF                 Yes            Yes         Yes           Yes
   IQueryable          Yes            Yes         Yes           7.5+
   MVVM                4.5            Yes         Yes           Yes
   MEF                 Yes            Yes         Yes
   Numerics            Yes            Yes         Yes
   Dynamic             4.5            Yes         Yes
   Annotations         4.0.3+         Yes         Yes


consulting      training     design   debugging                           wintellect.com
PCL in MSDN Documentation




consulting   training   design   debugging   wintellect.com
PCL in MSDN Documentation




consulting   training   design   debugging   wintellect.com
PCL and Model-View-ViewModel
 • .NET Framework 4.5, .NET for Windows Store apps,
   Silverlight, and Windows Phone
 • Observable collections (normal and read-only)
 • Notify property changed
 • Notify collection changed
 • Notify data error info
 • ICommand




consulting   training   design   debugging        wintellect.com
PCL + VS 2012 = Extension SDK
 • Software Development Kit (SDK) is a collection of files that Visual
   Studio will treat as a single item
      – Platform SDK – mandatory for a target platform, i.e. "Windows 8 SDK"
      – Extension SDK – optional components to extend a platform
 • Target Platform Moniker (TPM) = Identifier (TPI) and Version (TPV) ex:
   "Windows, version=8.0"
 • References (binaries, either .WinMD or
   assemblies), redistributables, and design-time components
 • Can drop any components to a path with a TPM and Visual Studio will
   substitute that path
 • Easy to see what the target profile is
 • Each combination of target platforms creates a unique profile



consulting   training   design   debugging                           wintellect.com
PCL Under the Covers
 •   Use ILDASM to inspect portable assemblies




 •   ICommand lives in System.Windows.dll for Silverlight, but System.dll in .NET
     4.5 and Windows.UI.Xaml.Input.dll in Windows Store apps ("retargetable")




consulting   training   design   debugging                              wintellect.com
PCL Under the Covers (cont.)
 •   Classic type forwarders route to the appropriate assembly




consulting   training   design   debugging                       wintellect.com
PCL Under the Covers (cont.)
 •   Windows Store apps forward to System.ObjectModel and language
     projections maps them to the WinRT framework




consulting   training   design   debugging                       wintellect.com
demo
   Basic MVVM with PCL




consulting   training   design   debugging   wintellect.com
Porting Existing Code
 • Always easier when implementing MVVM, but are your
   ViewModels tied to views (i.e. do you include XAML
   namespaces?)
 • Decoupled code is key
 • Identify key APIs that are platform-specific and implement
   façade
 • Common areas to refactor out include UI, networking, and
   storage
 • Convert an existing class library to a PCL assembly




consulting   training   design   debugging          wintellect.com
Porting Existing Code
 • You can convert an existing class library to a PCL
 • First, unload the project
 • Second, change the settings:
     <Import Project="$(MSBuildToolsPath)Microsoft.CSharp.targets"
     /> to
     <Import
     Project="$(MSBuildExtensionsPath32)MicrosoftPortable$(Target
     FrameworkVersion)Microsoft.Portable.CSharp.targets" />
 • Next, add the following project GUIDs to the end of the first property
   group – this adds the library tab and dialog to change the targets:
     <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-
     6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-
     00C04F79EFBC}</ProjectTypeGuids>
 • Finally, reload the project and select the target frameworks


consulting   training   design   debugging                        wintellect.com
Strategies for Building New Apps
 •   Follow S.O.L.I.D. Principles – they do make it easier
      –   Single responsibility – a class should only do one thing and change for one reason
      –   Open/closed principle – open for extension, closed for modification
      –   Liskov substitution principle – no side effects/unexpected behaviors when cast to a base class
      –   Interface segregation – interfaces should be focused on specific, targeted functionality
      –   Dependency Injection – keep dependencies external from your class and inject them
 •   Use MVVM and keep view-specific code in the view, not the view model
 •   Target the smallest number of frameworks possible in your portable
     assemblies to ensure the widest surface area of APIs to choose from, i.e. don't
     include Xbox if you're not going to write for it
 •   Pick a target platform to run your unit tests and only write tests for PCL
     assemblies in that target
 •   Don't forget to write unit tests for the classes that are specific to target
     platforms




consulting     training      design      debugging                                         wintellect.com
demo
   Wintellog: Windows Store and WPF




consulting   training   design   debugging   wintellect.com
Recap
 • PCL is native to VS 2012 and uses Extension SDKs
 • PCL maps target frameworks to profiles that represent a
   "lowest common denominator" of API surface area
 • Under the hood, PCL takes advantage of type forwarders
   and Windows 8 advances to enable the portable assembly
 • Existing code can be ported to use the PCL
 • New applications should take advantage of the PCL for
   various core assemblies, with storage and UI abstracted
   away
 • PCL should be a solid investment as the team is actively
   working on updates to keep pace with the latest

consulting   training   design   debugging         wintellect.com
Questions?




                            Jeremy Likness (@JeremyLikness)
                            Principal Consultant
                            jlikness@wintellect.com



consulting   training   design   debugging                    wintellect.com

Contenu connexe

Tendances

Introduction To NetBeans IDE
Introduction To NetBeans IDEIntroduction To NetBeans IDE
Introduction To NetBeans IDEMuhammad Ghazali
 
Building software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinBuilding software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinRikard Thulin
 
Silverlight difference faqs-1
Silverlight  difference faqs-1Silverlight  difference faqs-1
Silverlight difference faqs-1Umar Ali
 
A Lap Around Visual Studio 11
A Lap Around Visual Studio 11A Lap Around Visual Studio 11
A Lap Around Visual Studio 11Chad Green
 
Agile in Action - Act 3: Testing
Agile in Action - Act 3: TestingAgile in Action - Act 3: Testing
Agile in Action - Act 3: TestingSpiffy
 
Mainframe DevOps Using Zowe Open Source
Mainframe DevOps Using Zowe Open SourceMainframe DevOps Using Zowe Open Source
Mainframe DevOps Using Zowe Open SourceDevOps.com
 
Mobilize Your Business, Not Just an App
Mobilize Your Business, Not Just an AppMobilize Your Business, Not Just an App
Mobilize Your Business, Not Just an AppTeamstudio
 
Why do developers prefer ionic to build progressive web apps
Why do developers prefer ionic to build progressive web apps  Why do developers prefer ionic to build progressive web apps
Why do developers prefer ionic to build progressive web apps Moon Technolabs Pvt. Ltd.
 
Scaling Continuous Integration Practices to Teams with Parallel Development
Scaling Continuous Integration Practices to Teams with Parallel DevelopmentScaling Continuous Integration Practices to Teams with Parallel Development
Scaling Continuous Integration Practices to Teams with Parallel DevelopmentIBM UrbanCode Products
 
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...Perficient, Inc.
 
Laravel 9 is now out – how is an improvement over its predecessors
Laravel 9 is now out – how is an improvement over its predecessorsLaravel 9 is now out – how is an improvement over its predecessors
Laravel 9 is now out – how is an improvement over its predecessorsMoon Technolabs Pvt. Ltd.
 
Introduction to PHP H/MVC Frameworks by www.silicongulf.com
Introduction to PHP H/MVC Frameworks by www.silicongulf.comIntroduction to PHP H/MVC Frameworks by www.silicongulf.com
Introduction to PHP H/MVC Frameworks by www.silicongulf.comChristopher Cubos
 
Show110 | Using the XPages Extension Library for the Real World
Show110 | Using the XPages Extension Library for the Real WorldShow110 | Using the XPages Extension Library for the Real World
Show110 | Using the XPages Extension Library for the Real Worldpdhannan
 
.NET Fundamentals and Business Application Development
.NET Fundamentals and Business Application Development.NET Fundamentals and Business Application Development
.NET Fundamentals and Business Application Development명신 김
 
Extension Library - Viagra for XPages
Extension Library - Viagra for XPagesExtension Library - Viagra for XPages
Extension Library - Viagra for XPagesUlrich Krause
 
Developing XPages Applications
Developing XPages ApplicationsDeveloping XPages Applications
Developing XPages ApplicationsNiklas Heidloff
 

Tendances (20)

Introduction To NetBeans IDE
Introduction To NetBeans IDEIntroduction To NetBeans IDE
Introduction To NetBeans IDE
 
Building software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinBuilding software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard Thulin
 
Silverlight difference faqs-1
Silverlight  difference faqs-1Silverlight  difference faqs-1
Silverlight difference faqs-1
 
A Lap Around Visual Studio 11
A Lap Around Visual Studio 11A Lap Around Visual Studio 11
A Lap Around Visual Studio 11
 
Agile in Action - Act 3: Testing
Agile in Action - Act 3: TestingAgile in Action - Act 3: Testing
Agile in Action - Act 3: Testing
 
Mainframe DevOps Using Zowe Open Source
Mainframe DevOps Using Zowe Open SourceMainframe DevOps Using Zowe Open Source
Mainframe DevOps Using Zowe Open Source
 
Mobilize Your Business, Not Just an App
Mobilize Your Business, Not Just an AppMobilize Your Business, Not Just an App
Mobilize Your Business, Not Just an App
 
Eclipse Vs Netbeans
Eclipse Vs NetbeansEclipse Vs Netbeans
Eclipse Vs Netbeans
 
Delphi Prism XE Datasheet
Delphi Prism XE DatasheetDelphi Prism XE Datasheet
Delphi Prism XE Datasheet
 
Why do developers prefer ionic to build progressive web apps
Why do developers prefer ionic to build progressive web apps  Why do developers prefer ionic to build progressive web apps
Why do developers prefer ionic to build progressive web apps
 
Scaling Continuous Integration Practices to Teams with Parallel Development
Scaling Continuous Integration Practices to Teams with Parallel DevelopmentScaling Continuous Integration Practices to Teams with Parallel Development
Scaling Continuous Integration Practices to Teams with Parallel Development
 
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
 
Laravel 9 is now out – how is an improvement over its predecessors
Laravel 9 is now out – how is an improvement over its predecessorsLaravel 9 is now out – how is an improvement over its predecessors
Laravel 9 is now out – how is an improvement over its predecessors
 
Introduction to PHP H/MVC Frameworks by www.silicongulf.com
Introduction to PHP H/MVC Frameworks by www.silicongulf.comIntroduction to PHP H/MVC Frameworks by www.silicongulf.com
Introduction to PHP H/MVC Frameworks by www.silicongulf.com
 
Show110 | Using the XPages Extension Library for the Real World
Show110 | Using the XPages Extension Library for the Real WorldShow110 | Using the XPages Extension Library for the Real World
Show110 | Using the XPages Extension Library for the Real World
 
.NET Fundamentals and Business Application Development
.NET Fundamentals and Business Application Development.NET Fundamentals and Business Application Development
.NET Fundamentals and Business Application Development
 
Extension Library - Viagra for XPages
Extension Library - Viagra for XPagesExtension Library - Viagra for XPages
Extension Library - Viagra for XPages
 
Developing XPages Applications
Developing XPages ApplicationsDeveloping XPages Applications
Developing XPages Applications
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Real World Technologies
Real World TechnologiesReal World Technologies
Real World Technologies
 

Similaire à Wintellect - Devscovery - Portable Class Library

Wintellect - Windows 8 for the Silverlight and WPF Developer
Wintellect   - Windows 8 for the Silverlight and WPF DeveloperWintellect   - Windows 8 for the Silverlight and WPF Developer
Wintellect - Windows 8 for the Silverlight and WPF DeveloperJeremy Likness
 
Introduction to the Managed Extensibility Framework in Silverlight
Introduction to the Managed Extensibility Framework in SilverlightIntroduction to the Managed Extensibility Framework in Silverlight
Introduction to the Managed Extensibility Framework in SilverlightJeremy Likness
 
Introduction_to_NET.ppt
Introduction_to_NET.pptIntroduction_to_NET.ppt
Introduction_to_NET.pptDarwin Terraza
 
Windows 8: A Tale of Two Stacks
Windows 8: A Tale of Two StacksWindows 8: A Tale of Two Stacks
Windows 8: A Tale of Two StacksJeremy Likness
 
Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();dotNet Miami
 
c#.Net Windows application
c#.Net Windows application c#.Net Windows application
c#.Net Windows application veera
 
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013John Garland
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRainingsunil kumar
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Jeremy Likness
 
New voice, new tone, new IA: Writing for the modern developer
New voice, new tone, new IA: Writing for the modern developerNew voice, new tone, new IA: Writing for the modern developer
New voice, new tone, new IA: Writing for the modern developerKeith Boyd
 
Rcs project Training Bangalore
Rcs project Training BangaloreRcs project Training Bangalore
Rcs project Training BangaloreSunil Kumar
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixPeter Nazarov
 
AWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a TimeAWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a TimeAmazon Web Services
 
(WPF + WinForms) * .NET Core = Modern Desktop
(WPF + WinForms) * .NET Core = Modern Desktop(WPF + WinForms) * .NET Core = Modern Desktop
(WPF + WinForms) * .NET Core = Modern DesktopOren Novotny
 
Cincom Smalltalk News
Cincom Smalltalk NewsCincom Smalltalk News
Cincom Smalltalk NewsESUG
 
Moving microsoft .net applications one container at a time
 Moving microsoft .net applications one container at a time  Moving microsoft .net applications one container at a time
Moving microsoft .net applications one container at a time Amazon Web Services
 

Similaire à Wintellect - Devscovery - Portable Class Library (20)

Wintellect - Windows 8 for the Silverlight and WPF Developer
Wintellect   - Windows 8 for the Silverlight and WPF DeveloperWintellect   - Windows 8 for the Silverlight and WPF Developer
Wintellect - Windows 8 for the Silverlight and WPF Developer
 
Introduction to the Managed Extensibility Framework in Silverlight
Introduction to the Managed Extensibility Framework in SilverlightIntroduction to the Managed Extensibility Framework in Silverlight
Introduction to the Managed Extensibility Framework in Silverlight
 
Introduction_to_NET.ppt
Introduction_to_NET.pptIntroduction_to_NET.ppt
Introduction_to_NET.ppt
 
Windows 8: A Tale of Two Stacks
Windows 8: A Tale of Two StacksWindows 8: A Tale of Two Stacks
Windows 8: A Tale of Two Stacks
 
Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();Staying connected: An Overview of Announcements from Microsoft’s Connect();
Staying connected: An Overview of Announcements from Microsoft’s Connect();
 
c#.Net Windows application
c#.Net Windows application c#.Net Windows application
c#.Net Windows application
 
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
 
Net Beans
Net BeansNet Beans
Net Beans
 
Net Beans
Net BeansNet Beans
Net Beans
 
New voice, new tone, new IA: Writing for the modern developer
New voice, new tone, new IA: Writing for the modern developerNew voice, new tone, new IA: Writing for the modern developer
New voice, new tone, new IA: Writing for the modern developer
 
Rcs project Training Bangalore
Rcs project Training BangaloreRcs project Training Bangalore
Rcs project Training Bangalore
 
Desert Code Camp Presentation
Desert Code Camp PresentationDesert Code Camp Presentation
Desert Code Camp Presentation
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helix
 
AWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a TimeAWS Summit Auckland - Moving MS .NET Applications One Container at a Time
AWS Summit Auckland - Moving MS .NET Applications One Container at a Time
 
.Net @ Neev
.Net @ Neev.Net @ Neev
.Net @ Neev
 
(WPF + WinForms) * .NET Core = Modern Desktop
(WPF + WinForms) * .NET Core = Modern Desktop(WPF + WinForms) * .NET Core = Modern Desktop
(WPF + WinForms) * .NET Core = Modern Desktop
 
Cincom Smalltalk News
Cincom Smalltalk NewsCincom Smalltalk News
Cincom Smalltalk News
 
Moving microsoft .net applications one container at a time
 Moving microsoft .net applications one container at a time  Moving microsoft .net applications one container at a time
Moving microsoft .net applications one container at a time
 

Dernier

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Dernier (20)

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Wintellect - Devscovery - Portable Class Library

  • 1. Portable Class Library: Tomorrow's Apps Today Jeremy Likness (@JeremyLikness) Principal Consultant jlikness@wintellect.com Copyright © 2012 consulting training design debugging wintellect.com
  • 2. what we do consulting training design debugging who we are Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins – we pull out all the stops to help our customers achieve their goals through advanced software-based consulting and training solutions. how we do it Training • On-site instructor-led training Consulting & Debugging • Virtual instructor-led training • Architecture, analysis, and design services • Devscovery conferences • Full lifecycle custom software development • Content creation Design • Project management • User Experience Design • Debugging & performance tuning • Visual & Content Design • Video & Animation Production consulting training design debugging wintellect.com
  • 3. Building Windows 8 Apps with C# • http://bit.ly/win8design • Free source at: http://windows8applications.codeplex.com/ • Everything you need to build and deploy Windows Store apps using C# and XAML • Includes the portable project you will see today consulting training design debugging wintellect.com
  • 4. Agenda • Introduction to the Portable Class Library • Understanding Extension SDKs • Portable profiles • Chasing ICommand: PCL Under the Hood • Porting existing code • Strategies for building new applications • Comprehensive Example: Wintellog • PCL Futures consulting training design debugging wintellect.com
  • 5. Introducing PCL • Write and build managed assemblies that work (without recompiling) on more than one .NET Framework platform • Target frameworks include: – .NET Framework 4 and later (including WPF) – .NET for Windows Store apps (Windows 8) – Silverlight 4 and later – Windows Phone 7 and later – Xbox 360 • Eliminate sharing of source consulting training design debugging wintellect.com
  • 6. Supported Features Feature .NET Windows Silverlight Windows Xbox 360 Framework Store Phone Core Yes Yes Yes Yes Yes XLINQ 4.0.3+ Yes Yes Yes Yes LINQ Yes Yes Yes Yes Network Yes Yes Yes Yes Serialization Yes Yes Yes Yes WCF Yes Yes Yes Yes IQueryable Yes Yes Yes 7.5+ MVVM 4.5 Yes Yes Yes MEF Yes Yes Yes Numerics Yes Yes Yes Dynamic 4.5 Yes Yes Annotations 4.0.3+ Yes Yes consulting training design debugging wintellect.com
  • 7. PCL in MSDN Documentation consulting training design debugging wintellect.com
  • 8. PCL in MSDN Documentation consulting training design debugging wintellect.com
  • 9. PCL and Model-View-ViewModel • .NET Framework 4.5, .NET for Windows Store apps, Silverlight, and Windows Phone • Observable collections (normal and read-only) • Notify property changed • Notify collection changed • Notify data error info • ICommand consulting training design debugging wintellect.com
  • 10. PCL + VS 2012 = Extension SDK • Software Development Kit (SDK) is a collection of files that Visual Studio will treat as a single item – Platform SDK – mandatory for a target platform, i.e. "Windows 8 SDK" – Extension SDK – optional components to extend a platform • Target Platform Moniker (TPM) = Identifier (TPI) and Version (TPV) ex: "Windows, version=8.0" • References (binaries, either .WinMD or assemblies), redistributables, and design-time components • Can drop any components to a path with a TPM and Visual Studio will substitute that path • Easy to see what the target profile is • Each combination of target platforms creates a unique profile consulting training design debugging wintellect.com
  • 11. PCL Under the Covers • Use ILDASM to inspect portable assemblies • ICommand lives in System.Windows.dll for Silverlight, but System.dll in .NET 4.5 and Windows.UI.Xaml.Input.dll in Windows Store apps ("retargetable") consulting training design debugging wintellect.com
  • 12. PCL Under the Covers (cont.) • Classic type forwarders route to the appropriate assembly consulting training design debugging wintellect.com
  • 13. PCL Under the Covers (cont.) • Windows Store apps forward to System.ObjectModel and language projections maps them to the WinRT framework consulting training design debugging wintellect.com
  • 14. demo Basic MVVM with PCL consulting training design debugging wintellect.com
  • 15. Porting Existing Code • Always easier when implementing MVVM, but are your ViewModels tied to views (i.e. do you include XAML namespaces?) • Decoupled code is key • Identify key APIs that are platform-specific and implement façade • Common areas to refactor out include UI, networking, and storage • Convert an existing class library to a PCL assembly consulting training design debugging wintellect.com
  • 16. Porting Existing Code • You can convert an existing class library to a PCL • First, unload the project • Second, change the settings: <Import Project="$(MSBuildToolsPath)Microsoft.CSharp.targets" /> to <Import Project="$(MSBuildExtensionsPath32)MicrosoftPortable$(Target FrameworkVersion)Microsoft.Portable.CSharp.targets" /> • Next, add the following project GUIDs to the end of the first property group – this adds the library tab and dialog to change the targets: <ProjectTypeGuids>{786C830F-07A1-408B-BD7F- 6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B- 00C04F79EFBC}</ProjectTypeGuids> • Finally, reload the project and select the target frameworks consulting training design debugging wintellect.com
  • 17. Strategies for Building New Apps • Follow S.O.L.I.D. Principles – they do make it easier – Single responsibility – a class should only do one thing and change for one reason – Open/closed principle – open for extension, closed for modification – Liskov substitution principle – no side effects/unexpected behaviors when cast to a base class – Interface segregation – interfaces should be focused on specific, targeted functionality – Dependency Injection – keep dependencies external from your class and inject them • Use MVVM and keep view-specific code in the view, not the view model • Target the smallest number of frameworks possible in your portable assemblies to ensure the widest surface area of APIs to choose from, i.e. don't include Xbox if you're not going to write for it • Pick a target platform to run your unit tests and only write tests for PCL assemblies in that target • Don't forget to write unit tests for the classes that are specific to target platforms consulting training design debugging wintellect.com
  • 18. demo Wintellog: Windows Store and WPF consulting training design debugging wintellect.com
  • 19. Recap • PCL is native to VS 2012 and uses Extension SDKs • PCL maps target frameworks to profiles that represent a "lowest common denominator" of API surface area • Under the hood, PCL takes advantage of type forwarders and Windows 8 advances to enable the portable assembly • Existing code can be ported to use the PCL • New applications should take advantage of the PCL for various core assemblies, with storage and UI abstracted away • PCL should be a solid investment as the team is actively working on updates to keep pace with the latest consulting training design debugging wintellect.com
  • 20. Questions? Jeremy Likness (@JeremyLikness) Principal Consultant jlikness@wintellect.com consulting training design debugging wintellect.com

Notes de l'éditeur

  1. var one = 1;one;typeof one;var two = &apos;2&apos;,two;typeof two;var three = one + two;three;typeof three; var three = Number(one) + Number(two);typeof three;three;var one = [1,2,3];one;typeof one;var two = [&apos;1&apos;, &apos;2&apos;, &apos;3&apos;]two;typeof two;one[0] == two[0];one[0] === two[0];var three = one + two;typeof three;three;var three = one.concat(two);three;typeof three;
  2. var one = 1;one;typeof one;var two = &apos;2&apos;,two;typeof two;var three = one + two;three;typeof three; var three = Number(one) + Number(two);typeof three;three;var one = [1,2,3];one;typeof one;var two = [&apos;1&apos;, &apos;2&apos;, &apos;3&apos;]two;typeof two;one[0] == two[0];one[0] === two[0];var three = one + two;typeof three;three;var three = one.concat(two);three;typeof three;
  3. var one = 1;one;typeof one;var two = &apos;2&apos;,two;typeof two;var three = one + two;three;typeof three; var three = Number(one) + Number(two);typeof three;three;var one = [1,2,3];one;typeof one;var two = [&apos;1&apos;, &apos;2&apos;, &apos;3&apos;]two;typeof two;one[0] == two[0];one[0] === two[0];var three = one + two;typeof three;three;var three = one.concat(two);three;typeof three;
  4. var one = 1;one;typeof one;var two = &apos;2&apos;,two;typeof two;var three = one + two;three;typeof three; var three = Number(one) + Number(two);typeof three;three;var one = [1,2,3];one;typeof one;var two = [&apos;1&apos;, &apos;2&apos;, &apos;3&apos;]two;typeof two;one[0] == two[0];one[0] === two[0];var three = one + two;typeof three;three;var three = one.concat(two);three;typeof three;
  5. Show the original first. Run in IE8 and IE9, then show crash in IE7 – find out if students can even see where the crash is coming from.Run JSLint, note it stops after a short time and you have to keep making fixes to keep it moving. Note complaints about spaces. Show that the defect was addressed.Now configure JSHint and show that experience.
  6. Show the original first. Run in IE8 and IE9, then show crash in IE7 – find out if students can even see where the crash is coming from.Run JSLint, note it stops after a short time and you have to keep making fixes to keep it moving. Note complaints about spaces. Show that the defect was addressed.Now configure JSHint and show that experience.