SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
C# code sharing across the platforms
Andrei Marukovich
LunarFrog.com
twitter: @amarukovich
.NET ecosystem
.NET Framework .NET Core Xamarin
WPF
ASP.NET
WinForms UWP
ASP.NET Core
iOS
macOS
Android
Code sharing strategies
• Source file links
• Shared projects
• Portable class libraries (PCLs)
• .NET Standard
Shared projects
• Better version of the source file links
UWP project Xamarin project
File1.cs
File2.cs
SharedLib
File1.cs
File2.cs
SharedLib
File1.cs
File2.cs
SharedLibUI
App layer
UI
App layer
Shared projects
Shared projects
• Benefits
• Simple model
• May include platform-specific code
• Disadvantages
• Source-level sharing, no assembly
• Compiler directives
• Usability
Portable class libraries
• Sharing code in binary form, without recompiling
UWP project Xamarin project
File1.cs
File2.cs
PortableLib
UI
App layer
UI
App layer
How it works?
• PCLs are based on profiles
• Profile defines an API surface supported by the library
• Profile is identified by combination of supported platforms
• http://embed.plnkr.co/03ck2dCtnJogBKHJ9EjY
• C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETPortable
UWP
Profile API surface
Xamarin
Android
.NET
Framework
PCLs
Portable class libraries
• Benefits
• PCLs allow binary distribution
• API enforcement
• No context switching, simple refactoring
• Disadvantages
• PCL’s require upfront decision on the supported platforms
• Lowest common denominator for the selected platforms
• Cannot use compiler directives
• Long term maintainability
.NET Standard
• An evolution of PCLs
• .NET Standard defines a set of APIs to be implemented by .NET
platforms (specification)
• .NET Standard is versioned (API level)
• Library developers may choose target .NET Standard version
• Version defines API surface, not supported frameworks
• The higher the version, the more APIs you have
• The lower the version, the more .NET platforms implement it
• Analogy: https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7
.NET Standard
.NET platform support
.NET Standard 2.0
Big picture
.NET Standard
• Current state
• Tooling is in preview
• Currently PCLs support a wider range of platforms
• At the moment, PCL adoption (# of libraries) is higher than .NET Standard
• Future
• PCL replacement
• Standard 2.0 will have significantly larger API surface
• Standard 2.0 will be interoperable with .NET Framework
More information
• github.com/dotnet/standard
Thank you!
Andrei Marukovich
contact@lunarfrog.com
twitter: @amarukovich

Contenu connexe

Tendances

.NET Standard - Under the Hood
.NET Standard - Under the Hood.NET Standard - Under the Hood
.NET Standard - Under the HoodImmo Landwerth
 
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel ZikmundDotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
Building apps with common code for windows 8 and windows phone 8 (WP8)
Building apps with common code for windows 8 and windows phone 8 (WP8)Building apps with common code for windows 8 and windows phone 8 (WP8)
Building apps with common code for windows 8 and windows phone 8 (WP8)Tamir Dresher
 
Microsoft .Net Framework
Microsoft .Net FrameworkMicrosoft .Net Framework
Microsoft .Net FrameworkRohit Rao
 
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHEREECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHEREEuropean Collaboration Summit
 
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladoresQue hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladoresRodolfo Finochietti
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#SharePointKE
 
Five Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsFive Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsPerforce
 
.Net framework
.Net framework.Net framework
.Net frameworksanya6900
 
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Ken Cenerelli
 
Accelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentAccelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentMicro Focus
 
Recipy presentation #collabw15
Recipy presentation #collabw15Recipy presentation #collabw15
Recipy presentation #collabw15Raquel Alegre
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsSandeep Adwankar
 
The Python in the Apple
The Python in the AppleThe Python in the Apple
The Python in the ApplezeroSteiner
 

Tendances (20)

.NET Standard - Under the Hood
.NET Standard - Under the Hood.NET Standard - Under the Hood
.NET Standard - Under the Hood
 
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel ZikmundDotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
 
Building apps with common code for windows 8 and windows phone 8 (WP8)
Building apps with common code for windows 8 and windows phone 8 (WP8)Building apps with common code for windows 8 and windows phone 8 (WP8)
Building apps with common code for windows 8 and windows phone 8 (WP8)
 
Microsoft .Net Framework
Microsoft .Net FrameworkMicrosoft .Net Framework
Microsoft .Net Framework
 
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHEREECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
 
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladoresQue hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
Que hay de nuevo en 2013 en la plataforma Microsoft para desarrolladores
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
Five Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsFive Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce Streams
 
Manas
ManasManas
Manas
 
Presentation1
Presentation1Presentation1
Presentation1
 
.Net framework
.Net framework.Net framework
.Net framework
 
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
 
Accelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentAccelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol development
 
Recipy presentation #collabw15
Recipy presentation #collabw15Recipy presentation #collabw15
Recipy presentation #collabw15
 
.NET - The Current Spectrum
.NET -  The Current Spectrum.NET -  The Current Spectrum
.NET - The Current Spectrum
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical Skills
 
The Python in the Apple
The Python in the AppleThe Python in the Apple
The Python in the Apple
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 

En vedette

[3] silabus pai sma xi
[3] silabus pai sma xi[3] silabus pai sma xi
[3] silabus pai sma xiawalsepta84
 
Atmik_Soni_Resume
Atmik_Soni_ResumeAtmik_Soni_Resume
Atmik_Soni_ResumeAtmik Soni
 
Atoosa Samiei-Resume
Atoosa Samiei-ResumeAtoosa Samiei-Resume
Atoosa Samiei-ResumeAtoosa Samiei
 
ATIK SHEIKH(Resume) (1)
ATIK SHEIKH(Resume) (1)ATIK SHEIKH(Resume) (1)
ATIK SHEIKH(Resume) (1)Atik Sheikh
 
Business models
Business modelsBusiness models
Business modelsVJIMPGDM
 
Environmental complexity
Environmental complexityEnvironmental complexity
Environmental complexityVJIMPGDM
 
Biomedical waste management ppt final1
Biomedical waste management ppt final1Biomedical waste management ppt final1
Biomedical waste management ppt final1rashmi123vaish
 
Safety health and environment aspects in thermal power plants
Safety health and environment aspects in thermal power plantsSafety health and environment aspects in thermal power plants
Safety health and environment aspects in thermal power plantsVudugundla Kodandapani
 
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...Gulfam Raza
 

En vedette (14)

[3] silabus pai sma xi
[3] silabus pai sma xi[3] silabus pai sma xi
[3] silabus pai sma xi
 
Atul's Resume
Atul's ResumeAtul's Resume
Atul's Resume
 
Atmik_Soni_Resume
Atmik_Soni_ResumeAtmik_Soni_Resume
Atmik_Soni_Resume
 
Atoosa Samiei-Resume
Atoosa Samiei-ResumeAtoosa Samiei-Resume
Atoosa Samiei-Resume
 
ATIK SHEIKH(Resume) (1)
ATIK SHEIKH(Resume) (1)ATIK SHEIKH(Resume) (1)
ATIK SHEIKH(Resume) (1)
 
Business models
Business modelsBusiness models
Business models
 
Biomedical Waste Management
Biomedical Waste ManagementBiomedical Waste Management
Biomedical Waste Management
 
Makalah Sambiloto
Makalah Sambiloto Makalah Sambiloto
Makalah Sambiloto
 
Efusi pleura
Efusi pleuraEfusi pleura
Efusi pleura
 
Alzheimer's disease: Genetic Aspects
Alzheimer's disease: Genetic AspectsAlzheimer's disease: Genetic Aspects
Alzheimer's disease: Genetic Aspects
 
Environmental complexity
Environmental complexityEnvironmental complexity
Environmental complexity
 
Biomedical waste management ppt final1
Biomedical waste management ppt final1Biomedical waste management ppt final1
Biomedical waste management ppt final1
 
Safety health and environment aspects in thermal power plants
Safety health and environment aspects in thermal power plantsSafety health and environment aspects in thermal power plants
Safety health and environment aspects in thermal power plants
 
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
Principle & Applications of Transmission Electron Microscopy (TEM) & High Res...
 

Similaire à C# code sharing across the platforms

Whats new in .net for 2019
Whats new in .net for 2019Whats new in .net for 2019
Whats new in .net for 2019Rory Preddy
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele RialdiCodeFest
 
Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioNative App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioXamarin
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesVagif Abilov
 
Introduction to dot net
Introduction to dot netIntroduction to dot net
Introduction to dot netQIANG XU
 
ASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedAlex Thissen
 
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)citizenmatt
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET CoreKevin Leung
 
.Net Core Fall update
.Net Core Fall update.Net Core Fall update
.Net Core Fall updateMSDEVMTL
 
.NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016).NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016)citizenmatt
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...IncQuery Labs
 
.Net Core 3.0. What’s inside? Павло Голубович
.Net Core 3.0. What’s inside? Павло Голубович.Net Core 3.0. What’s inside? Павло Голубович
.Net Core 3.0. What’s inside? Павло ГолубовичSigma Software
 
Porting Projects to .NET 5
Porting Projects to .NET 5Porting Projects to .NET 5
Porting Projects to .NET 5Immo Landwerth
 

Similaire à C# code sharing across the platforms (20)

Whats new in .net for 2019
Whats new in .net for 2019Whats new in .net for 2019
Whats new in .net for 2019
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual StudioNative App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual Studio
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
Introduction to dot net
Introduction to dot netIntroduction to dot net
Introduction to dot net
 
ASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimagined
 
Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016
 
Dotnet.ppt
Dotnet.pptDotnet.ppt
Dotnet.ppt
 
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
The how-dare-you-call-me-an-idiot’s guide to the .NET Standard (NDC London 2017)
 
Best DotNet Training in Delhi
Best   DotNet Training  in DelhiBest   DotNet Training  in Delhi
Best DotNet Training in Delhi
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET Core
 
.Net Core Fall update
.Net Core Fall update.Net Core Fall update
.Net Core Fall update
 
.NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016).NET Core Blimey! (dotnetsheff Jan 2016)
.NET Core Blimey! (dotnetsheff Jan 2016)
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...Lessons learned from building Eclipse-based add-ons for commercial modeling t...
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
 
.Net Core 3.0. What’s inside? Павло Голубович
.Net Core 3.0. What’s inside? Павло Голубович.Net Core 3.0. What’s inside? Павло Голубович
.Net Core 3.0. What’s inside? Павло Голубович
 
Apache Cordova 4.x
Apache Cordova 4.xApache Cordova 4.x
Apache Cordova 4.x
 
Mini .net conf 2020
Mini .net conf 2020Mini .net conf 2020
Mini .net conf 2020
 
.NET (r)evolution
.NET (r)evolution.NET (r)evolution
.NET (r)evolution
 
Porting Projects to .NET 5
Porting Projects to .NET 5Porting Projects to .NET 5
Porting Projects to .NET 5
 

Plus de Andrei Marukovich

Using NuGet libraries in your application
Using NuGet libraries in your applicationUsing NuGet libraries in your application
Using NuGet libraries in your applicationAndrei Marukovich
 
Open Source Libraries for.NET developers
Open Source Libraries for.NET developersOpen Source Libraries for.NET developers
Open Source Libraries for.NET developersAndrei Marukovich
 
Reactive Extensions for .NET
Reactive Extensions for .NETReactive Extensions for .NET
Reactive Extensions for .NETAndrei Marukovich
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and awaitAndrei Marukovich
 
All about data persistence in Windows 8
All about data persistence in Windows 8All about data persistence in Windows 8
All about data persistence in Windows 8Andrei Marukovich
 
A Developer's View of Windows 8
A Developer's View of Windows 8A Developer's View of Windows 8
A Developer's View of Windows 8Andrei Marukovich
 

Plus de Andrei Marukovich (7)

Using NuGet libraries in your application
Using NuGet libraries in your applicationUsing NuGet libraries in your application
Using NuGet libraries in your application
 
Open Source Libraries for.NET developers
Open Source Libraries for.NET developersOpen Source Libraries for.NET developers
Open Source Libraries for.NET developers
 
Reactive Extensions for .NET
Reactive Extensions for .NETReactive Extensions for .NET
Reactive Extensions for .NET
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and await
 
All about data persistence in Windows 8
All about data persistence in Windows 8All about data persistence in Windows 8
All about data persistence in Windows 8
 
ATDD in practice
ATDD in practiceATDD in practice
ATDD in practice
 
A Developer's View of Windows 8
A Developer's View of Windows 8A Developer's View of Windows 8
A Developer's View of Windows 8
 

Dernier

Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdfMeon Technology
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfTobias Schneck
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 

Dernier (20)

Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdf
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 

C# code sharing across the platforms

  • 1. C# code sharing across the platforms Andrei Marukovich LunarFrog.com twitter: @amarukovich
  • 2. .NET ecosystem .NET Framework .NET Core Xamarin WPF ASP.NET WinForms UWP ASP.NET Core iOS macOS Android
  • 3. Code sharing strategies • Source file links • Shared projects • Portable class libraries (PCLs) • .NET Standard
  • 4. Shared projects • Better version of the source file links UWP project Xamarin project File1.cs File2.cs SharedLib File1.cs File2.cs SharedLib File1.cs File2.cs SharedLibUI App layer UI App layer
  • 6. Shared projects • Benefits • Simple model • May include platform-specific code • Disadvantages • Source-level sharing, no assembly • Compiler directives • Usability
  • 7. Portable class libraries • Sharing code in binary form, without recompiling UWP project Xamarin project File1.cs File2.cs PortableLib UI App layer UI App layer
  • 8. How it works? • PCLs are based on profiles • Profile defines an API surface supported by the library • Profile is identified by combination of supported platforms • http://embed.plnkr.co/03ck2dCtnJogBKHJ9EjY • C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETPortable
  • 10. PCLs
  • 11. Portable class libraries • Benefits • PCLs allow binary distribution • API enforcement • No context switching, simple refactoring • Disadvantages • PCL’s require upfront decision on the supported platforms • Lowest common denominator for the selected platforms • Cannot use compiler directives • Long term maintainability
  • 12. .NET Standard • An evolution of PCLs • .NET Standard defines a set of APIs to be implemented by .NET platforms (specification) • .NET Standard is versioned (API level) • Library developers may choose target .NET Standard version • Version defines API surface, not supported frameworks • The higher the version, the more APIs you have • The lower the version, the more .NET platforms implement it • Analogy: https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7
  • 17. .NET Standard • Current state • Tooling is in preview • Currently PCLs support a wider range of platforms • At the moment, PCL adoption (# of libraries) is higher than .NET Standard • Future • PCL replacement • Standard 2.0 will have significantly larger API surface • Standard 2.0 will be interoperable with .NET Framework