際際滷

際際滷Share a Scribd company logo
INTRODUCTION TO
PORTABLE CLASS LIBRARIES
MICHAEL JOHN T PENA
DEVELOPER / CONSULTANT
ABOUT ME
 Agile Developer at Accenture Inc  Avanade PDC
 Technology Enthusiast
 Startup Enthusiast
 Mentor to Students
 Loves Wine
ADVENT OF DIFFERENT PLATFORMS
 Windows 10
 Xamarin
 Desktop / Core .NET
 Xbox One
 Silverlight
THE CHALLENGE
 Sharing code between platforms were not that simple
 Each platform have a designated Class Library
 Shared Project is still limited
ORIGIN OF PCL
 Microsoft created a Visual Studio extension for VS2012 /
VS2013
HOW IT WORKS?
 You tick the platforms you like to support. Then
that portable class library will be sliced into
those libraries which are common to them.
VISUALIZATION
Windows 10 Xamarin
PCL
WHERE DO WE USUALLY USE PCL?
 Sharing Data Access and Service
Layer of Apps
 Sometimes on ViewModels
 Sharing Common Utilities and
Helper Classes
 Just One Unit Test for shared
Functionalities
SOME LIBRARIES THAT WORKS WITH PCL
 MVVM Light
 Json.NET
 Microsoft HTTP CLIENT Libraries (Microsoft.Net.Http / HttpClient)
SPECIAL CASE: WHAT IF YOU CANNOT SHARE CODE
BUT HAVE SAME BUSINESS LOGIC?
 Platform Indirection.
 You create custom code for that platform, but still extends the
same Interface.
 You use reflection to resolve the class at run time.
QUESTIONS AND ANSWERS?
CONTACTS
 www.fb.com/mjtpena
 www.linkedin.com/michaelpena
 mjtpena@outlook.com
 @mjtpena

More Related Content

Introduction to portable class libraries

  • 1. INTRODUCTION TO PORTABLE CLASS LIBRARIES MICHAEL JOHN T PENA DEVELOPER / CONSULTANT
  • 2. ABOUT ME Agile Developer at Accenture Inc Avanade PDC Technology Enthusiast Startup Enthusiast Mentor to Students Loves Wine
  • 3. ADVENT OF DIFFERENT PLATFORMS Windows 10 Xamarin Desktop / Core .NET Xbox One Silverlight
  • 4. THE CHALLENGE Sharing code between platforms were not that simple Each platform have a designated Class Library Shared Project is still limited
  • 5. ORIGIN OF PCL Microsoft created a Visual Studio extension for VS2012 / VS2013
  • 6. HOW IT WORKS? You tick the platforms you like to support. Then that portable class library will be sliced into those libraries which are common to them.
  • 8. WHERE DO WE USUALLY USE PCL? Sharing Data Access and Service Layer of Apps Sometimes on ViewModels Sharing Common Utilities and Helper Classes Just One Unit Test for shared Functionalities
  • 9. SOME LIBRARIES THAT WORKS WITH PCL MVVM Light Json.NET Microsoft HTTP CLIENT Libraries (Microsoft.Net.Http / HttpClient)
  • 10. SPECIAL CASE: WHAT IF YOU CANNOT SHARE CODE BUT HAVE SAME BUSINESS LOGIC? Platform Indirection. You create custom code for that platform, but still extends the same Interface. You use reflection to resolve the class at run time.
  • 11. QUESTIONS AND ANSWERS? CONTACTS www.fb.com/mjtpena www.linkedin.com/michaelpena mjtpena@outlook.com @mjtpena