SlideShare ist ein Scribd-Unternehmen logo
1 von 47
SOLID programming with 
portable class libraries 
Vagif Abilov
About myself 
• Mail: vagif.abilov@gmail.com 
• Twitter: @ooobject 
• GitHub: object 
• BitBucket: object 
• Blog: http://bloggingabout.net/blogs/vagif/default.aspx 
• Some articles: http://www.codeproject.com 
• Some open source projects: 
– Simple.Data OData adapter 
– Simple.OData.Client 
– MongOData 
– PCL Conformance Analyzer
Poll: do you care about PCL? 
• Are you familiar with the concept of PCL? 
• Have you used portable class libraries? 
• Have you built your own portable class libraries? 
• Do you maintain source code for applications that need 
to be deployed on multiple platforms?
By the way, what is «portability»? 
According to Wikipedia: 
Portability in high-level computer programming is the 
usability of the same software in different environments. 
Strategies for portability 
• Transferring installed program files to another computer of basically 
the same architecture. 
• Reinstalling a program from distribution files on another computer of 
basically the same architecture. 
• Building executable programs for different platforms from source 
code; this is what is usually understood by "porting".
Portabilitity definition (cont’d) 
Achieving portability between different processors, 
according to Wikipedia: 
• Non-web programs, installed upon a computer in the 
normal manner, can have more control, and yet achieve 
system portability by linking to the Java package. 
• Software can be recompiled and linked from source 
code for different operating systems and processors if 
written in a programming language supporting 
compilation for the platforms.
Innovative portability strategies 
• Xamarin products: compiling to native apps 
– Binding Objective-C libraries (iOS) 
– Binding Java libraries (Android) 
• Portable class libraries: managed assemblies that work 
on more than one .NET Framework platform 
– .NET 4.0, 4.0.3, 4.5 
– Silverlight 4, 5 
– Windows Phone 7, 7.5, 8 
– .NET for Windows Store applications 
– Xbox 360
Recompilation vs. binary reuse 
Does it really matter if we package code in 
reusable assemblies? Can we compile our 
code for a new target platform when we 
actually need it?
PCL advantages 
• If the code is not bound to a specific platform, then 
packaging it in a portable class library will guard it from 
unintended platform dependencies by enforcing 
portability constraints at early development stage 
• Packaging code as PCL may require introduction of 
higher level abstractions, extraction of interfaces, 
inversion of dependencies and provide guidance to 
follow SOLID principles
Platform support in PCL
Authoring portable class libraries
Case study 
From 
Simple.Data OData adapter 
to 
Simple.OData.Client PCL
What is Simple.Data 
• A lightweight, dynamic data access component for 
.NET 
• Written and maintained by Mark Rendle 
• Adapters for SQL Server, Oracle, Sqlite, MongoDB, 
OData, Oracle, PostgreSql, Informix 
• An alternative to ORM libraries, such as Entity 
Framework and NHibernate
Simple.Data code example 
var db = Database.Open(); 
var titles = db.Albums 
.All() 
.Select(db.Albums.Title) 
.Where(db.Albums.GenreId == 1 && 
db.Albums.AlbumId > 400);
Simple.Data OData adapter 
• An alternative to WCF DataServices client 
• Better fits RESTful nature of OData protocol than SOAP 
alike client code generation triggered with «Add Service 
Reference»
Simple.Data.OData code example 
var db = Database.Opener.Open( 
"http://packages.nuget.org/v1/FeedService.svc/"); 
var package1 = db.Packages 
.FindByTitle("Simple.Data.OData"); 
var package2 = db.Packages 
.Find(db.Packages.Title == "Simple.OData.Client"); 
Generate HTTP GET request URLs: 
Packages?$filter=Title+eq+%27Simple.Data.OData%27 
Packages?$filter=Title+eq+%27Simple.OData.Client%27
Adapter 
• Structural design pattern 
• Converts the interface of a class into another interface 
clients expect 
Common API 
Adapter 
External service
Simple.Data OData version <= 0.5 
Simple.Data API 
Simple.Data OData Adapter 
OData protocol
ODataPad
Making the adapter portable 
• An adapter can target new platforms as long as it 
provides a bridge between interfaces (and interfaces 
don’t refer to types bound to specific platforms) 
• OData protocol is platform agnostic 
• Most of OData adapter code deals with either parsing 
XML documents returned by an OData service or 
formatting CLR objects as XML documents to send to 
OData service 
• Simple.Data API uses types defined in Simple.Data 
library 
• Simple.Data supports Mono (hope of portability with 
other platforms)
Targeting Windows Store apps
System.Data namespace 
• Microsoft.SqlServer.Server 
• System.Configuration 
• System.Data 
• System.Data.Common 
• System.Data.Odbc 
• System.Data.OleDb 
• System.Data.Sql 
• System.Data.SqlClient 
• System.Data.SqlTypes 
• System.Xml
PCL Conformance Analyzer 
Demo
Simple.Data.OData version >= 0.6 
Simple.Data API 
Simple.Data OData Adapter 
Simple.OData.Client PCL 
OData protocol
Simple.OData.Client 
• Version 0.13 
– .NET 4.0, .NET 4.0.3, 4.5 
– Windows Store 
– Silverlight 5 
– Windows Phone 8 
• Version 0.17 
– Xamarin.Android 
– Xamarin.iOS
But what about SOLID principles? 
Example 
Adding support for authentication
User request: support authentication 
• First implementation: accept user credentials (user + 
password), create authentication object using one of 
supported schemes (Basic, Windows etc.) 
• Worked like a charm, easy to use in client code 
var odataFeed = new ODataFeed( 
"http://www.myservice.com/api", 
"Vagif", 
"Password123"); 
• At that time Simple.Data OData adapter included non-portable 
version of Simple.OData.Client
ODataFeed 
public class ODataFeed 
{ 
public string Url { get; set; } 
public string User { get; set; } 
public string Password { get; set; } 
public string Domain { get; set; } 
public bool IntegratedSecurity { get; set; } 
}
Creating Web request 
var request = (HttpWebRequest)WebRequest.Create(uri); 
if (this.Credentials.IntegratedSecurity) 
{ 
request.Credentials = CredentialCache.DefaultNetworkCredentials; 
} 
else if (!string.IsNullOrEmpty(this.Credentials.User)) 
{ 
request.Credentials = new NetworkCredential( 
this.Credentials.User, 
this.Credentials.Password, 
this.Credentials.Domain); 
}
Merging with Portable branch 
Project doesn’t compile! 
• System.Net.CredentialCache: .NET 4.x only 
• System.Net.NetworkCredential: most of platforms
What went wrong? 
• Simple.Data OData adapter took responsibility to create 
user credentials based on sensitive user information 
• Leaving aside security aspects, the adapter violated 
single responsibility principle 
• The adapter restricted supported authentication metods 
to those provided by credential creation code 
• The adapter is not open to extending it with new 
authentication methods, so it violated open/closed 
principle too 
• Use of interface segregation principle would avoid this 
mistake 
• PCL compliance forced use of interfaces
Revised implementation 
In platform-spefic client code 
var odataFeed = new ODataFeed( 
"http://www.myservice.com/api", 
credentials); 
In Simple.OData.Client PCL 
var request = (HttpWebRequest)WebRequest.Create(uri); 
request.Credentials = this.Credentials;
Revised implementation 
• Credentials is an instance of a class that implements 
System.Net.ICredentials interface 
• Neither Simple.Data OData adapter (.NET 4.x) nor 
Simple.OData.Client refer to a specific authentication 
scheme 
• All present and future authentication schemes are 
supported as long as they conform ICredentials
Observations 
• Some SOLID principles require coding discipline and 
leave a room for interpretation, IMHO especially SRP 
and OCP (John Skeet on OCP: «While I've obviously considered the 
possibility that I'm the only one who finds it confusing, I've heard enough variation in 
the explanations of it to suggest that I'm really not the only one») 
• PCL conformance requirement doesn’t release you 
from the responsibility to make the design decision, but 
it can guard you from making obvious mistakes and 
sometimes even guide you in a right direction 
• PCLs make you more carefully plan service 
instantiation and use of non-functional utilities (logging, 
instrumentation etc.)
PCLs and concrete classes 
• Portable class libraries do not push the work of 
implementing platform-specific services to client 
applications 
• PCLs can be packaged as a single portable deployment 
unit 
– Autofac 
– Json.NET 
– Simple.OData.Client 
• PCLs can also be compound, consisting of core 
portable and platform-specific parts 
– MetroLog 
– Splat
MetroLog architecture
MetroLog NuGet specification 
<files> 
<file src="MetroLog.dll" target="libportable-net45+ 
wp8+win8MetroLog.dll" /> 
<file src="MetroLog.dll" target="libnet45MetroLog.dll" /> 
<file src="MetroLog.NetFx.dll" target="libnet45MetroLog.NetFx.dll" /> 
<file src="MetroLog.dll" target="libnetcore45MetroLog.dll" /> 
<file src="MetroLog.NetCore.dll" 
target="libnetcore45MetroLog.NetCore.dll" /> 
</files>
PCLs consuming PCLs 
• A PCL client can also be a portable library 
• Client target platforms must be a subset of the 
referenced PCL’s target platforms 
• Functionality that requires platform-specific services is 
usually referred using interfaces and abstract classes 
• There is a trick to use concrete platform-specific 
classes in client PCLs by placing in the referenced PCL 
a dummy class with the same API surface and 
assembly identity as the platform-specific class
PCL profiles and portable subsets 
• Profile is a set of supported platforms 
• Portable subset is a family of profiles that expose 
certain version of .NET FX API surface area 
– Profile 78: Portable Subset: 
• .NET 4.5 
• Windows Phone 8 
• Windows Store 
– Profile 95: Portable Subset (Legacy): 
• .NET 4.0.3 and higher 
• Silverlight 4 and higher 
• Windows Phone 7 and higher 
• Windows Store
PCLs for Android and iOS 
Demo: Xamarin .NET Mobility Scanner 
Example: Reflection API portability
Polyglot programming with PCLs 
• Use right language to solve specific problems 
• C# provides the best ‘one size fits all’ choice 
• F# is very efficient for immutable data transformations, 
financial computations, machine learning 
• F# code can be packaged in a PCL and shared among 
different platforms (inluding Android and iOS!) 
– No official support to target Windows Phone 8 using F# PCL, but there 
is a workaround 
– Both PCL and F# support in Xamarin are work in progress (with 
changes being made literally while I am speaking now) 
• Core logic can be written in C# and F# and packaged 
as PCL, and UI is added using platform-specific tools
PCLs for the future 
• Profiles for v.4.0 API surface are being deprecated 
• Visual Studio 2013 can open PCLs that target legacy 
platforms, but it will upgrade Silverlight to target version 
5 and Windows Phone to target version 8 
• Xamarin PCLs targets both v.4.0 and v.4.5 API surfaces 
• If a library target wide range of platforms (both 4.0 and 
4.5), its NuGet package should include separate binaries 
for each surface 
• Consider only targeting v.4.5 API surface for new 
projects unless you need to support legacy platforms
Using PCLs in UI 
• Use of portable class libraries can result in significant 
code reuse in cross-platform application development 
• Most popular approach to cross-platform UI with PCLs 
is to use MVVM pattern and package core services, 
models and view models in a portable library 
• Most popular MVVM frameworks that have PCLs are 
MvvmLights and MvvmCross 
• MvvmCross supports targeting Xamarin.iOS and 
Xamarin.Android (and provides phenomenal support at 
StackOverflow by @slodge)
Example: Lions Roar 
• Developed by Sequence Agency 
• UI is built using MvvmCross 
• View models PCL (2463 LOC) 
• Entities PCL (691 LOC) 
• Supported plalforms 
– Windows Store (1166 LOC) 
– Windows Phone 8 (668) 
– Android Phone/Tablet (1172) 
– iPhone/iPad (2000 LOC)
Using PCL in ODataPad UI 
• ODataPad views show images 
• Original view model design included core portable base 
view model (without image data) and platform-specific 
view models (with image data) 
• Small picture size makes possible storing images in 
base64 format and reuse a single view model in all 
platforms 
• Rendering images requires platform-specific value 
converters 
• A PCL with a design-time view model serves design 
data to all Visual Studio designers (Blend)
Conclusion 
• Portable class libraries are not only for binary reuse 
• Packaging code as PCLs helps making code cleaner: 
– Extract interfaces 
– Unify platform-specific services 
– Inject service dependencies 
– Use portable data structures 
• Consider PCLs when choosing third party libraries 
– Ready for other platforms 
– Indication of a proper design 
– May only have dependencies to other portable libraries 
• Consider make your next library portable even if you 
only target a single platform!
Resources 
• Daniel Plaisted «How to Make Portable Class Libraries 
Work for You» 
• Scott Hanselman «Cross-Platform Portable Class 
Libraries with .NET are Happening» 
Open source projects at GitHub: 
• AutoFac 
• MetroLog 
• Splat 
• MvvmCross 
• Simple.OData.Client
Thank you! 
• Mail: vagif.abilov@gmail.com 
• Twitter: @ooobject 
• GitHub: object 
• BitBucket: object 
• Blog: http://bloggingabout.net/blogs/vagif/default.aspx 
The source code for this PCL Conformance Analyzer can 
be found at https://github.com/object/PclAnalyzer

Weitere ähnliche Inhalte

Was ist angesagt?

Software job options
Software job optionsSoftware job options
Software job optionsMohit Kanwar
 
Integrating Alfresco with Portals
Integrating Alfresco with PortalsIntegrating Alfresco with Portals
Integrating Alfresco with PortalsPiergiorgio Lucidi
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack ImplementationMert Çalışkan
 
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012EJB 3.2 - Java EE 7 - Java One Hyderabad 2012
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012Jagadish Prasath
 
Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)
Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)
Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)Nedelcho Delchev
 
Take a Groovy REST
Take a Groovy RESTTake a Groovy REST
Take a Groovy RESTRestlet
 
Ekon21 Microservices - SOLID Meets SOA
Ekon21 Microservices - SOLID Meets SOAEkon21 Microservices - SOLID Meets SOA
Ekon21 Microservices - SOLID Meets SOAArnaud Bouchez
 
What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)Paul Withers
 
2.3 (Architecture) Moving to Managed Code
2.3   (Architecture) Moving to Managed Code2.3   (Architecture) Moving to Managed Code
2.3 (Architecture) Moving to Managed CodeMicro Focus
 
ASP.NET 01 - Introduction
ASP.NET 01 - IntroductionASP.NET 01 - Introduction
ASP.NET 01 - IntroductionRandy Connolly
 
.Net programming with C#
.Net programming with C#.Net programming with C#
.Net programming with C#NguynSang29
 
Modern web application development with java ee 7
Modern web application development with java ee 7Modern web application development with java ee 7
Modern web application development with java ee 7Shekhar Gulati
 

Was ist angesagt? (15)

Software job options
Software job optionsSoftware job options
Software job options
 
Integrating Alfresco with Portals
Integrating Alfresco with PortalsIntegrating Alfresco with Portals
Integrating Alfresco with Portals
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
 
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012EJB 3.2 - Java EE 7 - Java One Hyderabad 2012
EJB 3.2 - Java EE 7 - Java One Hyderabad 2012
 
WebLogic and GraalVM
WebLogic and GraalVMWebLogic and GraalVM
WebLogic and GraalVM
 
Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)
Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)
Dirigible powered by Orion for Cloud Development (EclipseCon EU 2015)
 
Net framework
Net frameworkNet framework
Net framework
 
Take a Groovy REST
Take a Groovy RESTTake a Groovy REST
Take a Groovy REST
 
Spring
SpringSpring
Spring
 
Ekon21 Microservices - SOLID Meets SOA
Ekon21 Microservices - SOLID Meets SOAEkon21 Microservices - SOLID Meets SOA
Ekon21 Microservices - SOLID Meets SOA
 
What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)
 
2.3 (Architecture) Moving to Managed Code
2.3   (Architecture) Moving to Managed Code2.3   (Architecture) Moving to Managed Code
2.3 (Architecture) Moving to Managed Code
 
ASP.NET 01 - Introduction
ASP.NET 01 - IntroductionASP.NET 01 - Introduction
ASP.NET 01 - Introduction
 
.Net programming with C#
.Net programming with C#.Net programming with C#
.Net programming with C#
 
Modern web application development with java ee 7
Modern web application development with java ee 7Modern web application development with java ee 7
Modern web application development with java ee 7
 

Andere mochten auch

Cross-platform Mobile Development using Portable Class Libraries
Cross-platform Mobile Development using Portable Class LibrariesCross-platform Mobile Development using Portable Class Libraries
Cross-platform Mobile Development using Portable Class LibrariesVagif Abilov
 
F# in Action: Playing Functional Conway's Game of Life
F# in Action: Playing Functional Conway's Game of LifeF# in Action: Playing Functional Conway's Game of Life
F# in Action: Playing Functional Conway's Game of LifeVagif Abilov
 
А нам-то зачем функциональное программирование?
А нам-то зачем функциональное программирование?А нам-то зачем функциональное программирование?
А нам-то зачем функциональное программирование?Vagif Abilov
 
Staying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsStaying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsVagif Abilov
 
iSeries Modernization: RPG/400 to Java Migration
iSeries Modernization: RPG/400 to Java MigrationiSeries Modernization: RPG/400 to Java Migration
iSeries Modernization: RPG/400 to Java Migrationecubemarketing
 

Andere mochten auch (6)

Cross-platform Mobile Development using Portable Class Libraries
Cross-platform Mobile Development using Portable Class LibrariesCross-platform Mobile Development using Portable Class Libraries
Cross-platform Mobile Development using Portable Class Libraries
 
F# in Action: Playing Functional Conway's Game of Life
F# in Action: Playing Functional Conway's Game of LifeF# in Action: Playing Functional Conway's Game of Life
F# in Action: Playing Functional Conway's Game of Life
 
А нам-то зачем функциональное программирование?
А нам-то зачем функциональное программирование?А нам-то зачем функциональное программирование?
А нам-то зачем функциональное программирование?
 
Staying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsStaying Close to Experts with Executable Specifications
Staying Close to Experts with Executable Specifications
 
iSeries Modernization: RPG/400 to Java Migration
iSeries Modernization: RPG/400 to Java MigrationiSeries Modernization: RPG/400 to Java Migration
iSeries Modernization: RPG/400 to Java Migration
 
Unificacion Alemana
Unificacion AlemanaUnificacion Alemana
Unificacion Alemana
 

Ähnlich wie SOLID Programming with Portable Class Libraries

MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelAlex Thissen
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native BootcampVMware Tanzu
 
Service fabric and azure service fabric mesh
Service fabric and azure service fabric meshService fabric and azure service fabric mesh
Service fabric and azure service fabric meshMikkel Mørk Hegnhøj
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Anupam Ranku
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Coremohamed elshafey
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los AngelesVMware Tanzu
 
Current & Future Use-Cases of OpenDaylight
Current & Future Use-Cases of OpenDaylightCurrent & Future Use-Cases of OpenDaylight
Current & Future Use-Cases of OpenDaylightabhijit2511
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5mbaric
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET CoreKevin Leung
 
Dot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineDot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineGaruda Trainings
 
{code} and Containers - Open Source Infrastructure within Dell Technologies
{code} and Containers - Open Source Infrastructure within Dell Technologies{code} and Containers - Open Source Infrastructure within Dell Technologies
{code} and Containers - Open Source Infrastructure within Dell TechnologiesThe {code} Team
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIGert Drapers
 
How AD has been re-engineered to extend to the cloud
How AD has been re-engineered to extend to the cloudHow AD has been re-engineered to extend to the cloud
How AD has been re-engineered to extend to the cloudLDAPCon
 
.NET Core: a new .NET Platform
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET PlatformAlex Thissen
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014Hojoong Kim
 

Ähnlich wie SOLID Programming with Portable Class Libraries (20)

MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp
 
Service fabric and azure service fabric mesh
Service fabric and azure service fabric meshService fabric and azure service fabric mesh
Service fabric and azure service fabric mesh
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
{code} and containers
{code} and containers{code} and containers
{code} and containers
 
.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles.NET Cloud-Native Bootcamp- Los Angeles
.NET Cloud-Native Bootcamp- Los Angeles
 
Current & Future Use-Cases of OpenDaylight
Current & Future Use-Cases of OpenDaylightCurrent & Future Use-Cases of OpenDaylight
Current & Future Use-Cases of OpenDaylight
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
Apache Cordova 4.x
Apache Cordova 4.xApache Cordova 4.x
Apache Cordova 4.x
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET Core
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Dot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineDot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement online
 
{code} and Containers - Open Source Infrastructure within Dell Technologies
{code} and Containers - Open Source Infrastructure within Dell Technologies{code} and Containers - Open Source Infrastructure within Dell Technologies
{code} and Containers - Open Source Infrastructure within Dell Technologies
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPI
 
How AD has been re-engineered to extend to the cloud
How AD has been re-engineered to extend to the cloudHow AD has been re-engineered to extend to the cloud
How AD has been re-engineered to extend to the cloud
 
.NET Core: a new .NET Platform
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET Platform
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
 

Kürzlich hochgeladen

Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 

Kürzlich hochgeladen (20)

Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 

SOLID Programming with Portable Class Libraries

  • 1. SOLID programming with portable class libraries Vagif Abilov
  • 2. About myself • Mail: vagif.abilov@gmail.com • Twitter: @ooobject • GitHub: object • BitBucket: object • Blog: http://bloggingabout.net/blogs/vagif/default.aspx • Some articles: http://www.codeproject.com • Some open source projects: – Simple.Data OData adapter – Simple.OData.Client – MongOData – PCL Conformance Analyzer
  • 3. Poll: do you care about PCL? • Are you familiar with the concept of PCL? • Have you used portable class libraries? • Have you built your own portable class libraries? • Do you maintain source code for applications that need to be deployed on multiple platforms?
  • 4. By the way, what is «portability»? According to Wikipedia: Portability in high-level computer programming is the usability of the same software in different environments. Strategies for portability • Transferring installed program files to another computer of basically the same architecture. • Reinstalling a program from distribution files on another computer of basically the same architecture. • Building executable programs for different platforms from source code; this is what is usually understood by "porting".
  • 5. Portabilitity definition (cont’d) Achieving portability between different processors, according to Wikipedia: • Non-web programs, installed upon a computer in the normal manner, can have more control, and yet achieve system portability by linking to the Java package. • Software can be recompiled and linked from source code for different operating systems and processors if written in a programming language supporting compilation for the platforms.
  • 6. Innovative portability strategies • Xamarin products: compiling to native apps – Binding Objective-C libraries (iOS) – Binding Java libraries (Android) • Portable class libraries: managed assemblies that work on more than one .NET Framework platform – .NET 4.0, 4.0.3, 4.5 – Silverlight 4, 5 – Windows Phone 7, 7.5, 8 – .NET for Windows Store applications – Xbox 360
  • 7. Recompilation vs. binary reuse Does it really matter if we package code in reusable assemblies? Can we compile our code for a new target platform when we actually need it?
  • 8. PCL advantages • If the code is not bound to a specific platform, then packaging it in a portable class library will guard it from unintended platform dependencies by enforcing portability constraints at early development stage • Packaging code as PCL may require introduction of higher level abstractions, extraction of interfaces, inversion of dependencies and provide guidance to follow SOLID principles
  • 11. Case study From Simple.Data OData adapter to Simple.OData.Client PCL
  • 12. What is Simple.Data • A lightweight, dynamic data access component for .NET • Written and maintained by Mark Rendle • Adapters for SQL Server, Oracle, Sqlite, MongoDB, OData, Oracle, PostgreSql, Informix • An alternative to ORM libraries, such as Entity Framework and NHibernate
  • 13. Simple.Data code example var db = Database.Open(); var titles = db.Albums .All() .Select(db.Albums.Title) .Where(db.Albums.GenreId == 1 && db.Albums.AlbumId > 400);
  • 14. Simple.Data OData adapter • An alternative to WCF DataServices client • Better fits RESTful nature of OData protocol than SOAP alike client code generation triggered with «Add Service Reference»
  • 15. Simple.Data.OData code example var db = Database.Opener.Open( "http://packages.nuget.org/v1/FeedService.svc/"); var package1 = db.Packages .FindByTitle("Simple.Data.OData"); var package2 = db.Packages .Find(db.Packages.Title == "Simple.OData.Client"); Generate HTTP GET request URLs: Packages?$filter=Title+eq+%27Simple.Data.OData%27 Packages?$filter=Title+eq+%27Simple.OData.Client%27
  • 16. Adapter • Structural design pattern • Converts the interface of a class into another interface clients expect Common API Adapter External service
  • 17. Simple.Data OData version <= 0.5 Simple.Data API Simple.Data OData Adapter OData protocol
  • 19. Making the adapter portable • An adapter can target new platforms as long as it provides a bridge between interfaces (and interfaces don’t refer to types bound to specific platforms) • OData protocol is platform agnostic • Most of OData adapter code deals with either parsing XML documents returned by an OData service or formatting CLR objects as XML documents to send to OData service • Simple.Data API uses types defined in Simple.Data library • Simple.Data supports Mono (hope of portability with other platforms)
  • 21. System.Data namespace • Microsoft.SqlServer.Server • System.Configuration • System.Data • System.Data.Common • System.Data.Odbc • System.Data.OleDb • System.Data.Sql • System.Data.SqlClient • System.Data.SqlTypes • System.Xml
  • 23. Simple.Data.OData version >= 0.6 Simple.Data API Simple.Data OData Adapter Simple.OData.Client PCL OData protocol
  • 24. Simple.OData.Client • Version 0.13 – .NET 4.0, .NET 4.0.3, 4.5 – Windows Store – Silverlight 5 – Windows Phone 8 • Version 0.17 – Xamarin.Android – Xamarin.iOS
  • 25. But what about SOLID principles? Example Adding support for authentication
  • 26. User request: support authentication • First implementation: accept user credentials (user + password), create authentication object using one of supported schemes (Basic, Windows etc.) • Worked like a charm, easy to use in client code var odataFeed = new ODataFeed( "http://www.myservice.com/api", "Vagif", "Password123"); • At that time Simple.Data OData adapter included non-portable version of Simple.OData.Client
  • 27. ODataFeed public class ODataFeed { public string Url { get; set; } public string User { get; set; } public string Password { get; set; } public string Domain { get; set; } public bool IntegratedSecurity { get; set; } }
  • 28. Creating Web request var request = (HttpWebRequest)WebRequest.Create(uri); if (this.Credentials.IntegratedSecurity) { request.Credentials = CredentialCache.DefaultNetworkCredentials; } else if (!string.IsNullOrEmpty(this.Credentials.User)) { request.Credentials = new NetworkCredential( this.Credentials.User, this.Credentials.Password, this.Credentials.Domain); }
  • 29. Merging with Portable branch Project doesn’t compile! • System.Net.CredentialCache: .NET 4.x only • System.Net.NetworkCredential: most of platforms
  • 30. What went wrong? • Simple.Data OData adapter took responsibility to create user credentials based on sensitive user information • Leaving aside security aspects, the adapter violated single responsibility principle • The adapter restricted supported authentication metods to those provided by credential creation code • The adapter is not open to extending it with new authentication methods, so it violated open/closed principle too • Use of interface segregation principle would avoid this mistake • PCL compliance forced use of interfaces
  • 31. Revised implementation In platform-spefic client code var odataFeed = new ODataFeed( "http://www.myservice.com/api", credentials); In Simple.OData.Client PCL var request = (HttpWebRequest)WebRequest.Create(uri); request.Credentials = this.Credentials;
  • 32. Revised implementation • Credentials is an instance of a class that implements System.Net.ICredentials interface • Neither Simple.Data OData adapter (.NET 4.x) nor Simple.OData.Client refer to a specific authentication scheme • All present and future authentication schemes are supported as long as they conform ICredentials
  • 33. Observations • Some SOLID principles require coding discipline and leave a room for interpretation, IMHO especially SRP and OCP (John Skeet on OCP: «While I've obviously considered the possibility that I'm the only one who finds it confusing, I've heard enough variation in the explanations of it to suggest that I'm really not the only one») • PCL conformance requirement doesn’t release you from the responsibility to make the design decision, but it can guard you from making obvious mistakes and sometimes even guide you in a right direction • PCLs make you more carefully plan service instantiation and use of non-functional utilities (logging, instrumentation etc.)
  • 34. PCLs and concrete classes • Portable class libraries do not push the work of implementing platform-specific services to client applications • PCLs can be packaged as a single portable deployment unit – Autofac – Json.NET – Simple.OData.Client • PCLs can also be compound, consisting of core portable and platform-specific parts – MetroLog – Splat
  • 36. MetroLog NuGet specification <files> <file src="MetroLog.dll" target="libportable-net45+ wp8+win8MetroLog.dll" /> <file src="MetroLog.dll" target="libnet45MetroLog.dll" /> <file src="MetroLog.NetFx.dll" target="libnet45MetroLog.NetFx.dll" /> <file src="MetroLog.dll" target="libnetcore45MetroLog.dll" /> <file src="MetroLog.NetCore.dll" target="libnetcore45MetroLog.NetCore.dll" /> </files>
  • 37. PCLs consuming PCLs • A PCL client can also be a portable library • Client target platforms must be a subset of the referenced PCL’s target platforms • Functionality that requires platform-specific services is usually referred using interfaces and abstract classes • There is a trick to use concrete platform-specific classes in client PCLs by placing in the referenced PCL a dummy class with the same API surface and assembly identity as the platform-specific class
  • 38. PCL profiles and portable subsets • Profile is a set of supported platforms • Portable subset is a family of profiles that expose certain version of .NET FX API surface area – Profile 78: Portable Subset: • .NET 4.5 • Windows Phone 8 • Windows Store – Profile 95: Portable Subset (Legacy): • .NET 4.0.3 and higher • Silverlight 4 and higher • Windows Phone 7 and higher • Windows Store
  • 39. PCLs for Android and iOS Demo: Xamarin .NET Mobility Scanner Example: Reflection API portability
  • 40. Polyglot programming with PCLs • Use right language to solve specific problems • C# provides the best ‘one size fits all’ choice • F# is very efficient for immutable data transformations, financial computations, machine learning • F# code can be packaged in a PCL and shared among different platforms (inluding Android and iOS!) – No official support to target Windows Phone 8 using F# PCL, but there is a workaround – Both PCL and F# support in Xamarin are work in progress (with changes being made literally while I am speaking now) • Core logic can be written in C# and F# and packaged as PCL, and UI is added using platform-specific tools
  • 41. PCLs for the future • Profiles for v.4.0 API surface are being deprecated • Visual Studio 2013 can open PCLs that target legacy platforms, but it will upgrade Silverlight to target version 5 and Windows Phone to target version 8 • Xamarin PCLs targets both v.4.0 and v.4.5 API surfaces • If a library target wide range of platforms (both 4.0 and 4.5), its NuGet package should include separate binaries for each surface • Consider only targeting v.4.5 API surface for new projects unless you need to support legacy platforms
  • 42. Using PCLs in UI • Use of portable class libraries can result in significant code reuse in cross-platform application development • Most popular approach to cross-platform UI with PCLs is to use MVVM pattern and package core services, models and view models in a portable library • Most popular MVVM frameworks that have PCLs are MvvmLights and MvvmCross • MvvmCross supports targeting Xamarin.iOS and Xamarin.Android (and provides phenomenal support at StackOverflow by @slodge)
  • 43. Example: Lions Roar • Developed by Sequence Agency • UI is built using MvvmCross • View models PCL (2463 LOC) • Entities PCL (691 LOC) • Supported plalforms – Windows Store (1166 LOC) – Windows Phone 8 (668) – Android Phone/Tablet (1172) – iPhone/iPad (2000 LOC)
  • 44. Using PCL in ODataPad UI • ODataPad views show images • Original view model design included core portable base view model (without image data) and platform-specific view models (with image data) • Small picture size makes possible storing images in base64 format and reuse a single view model in all platforms • Rendering images requires platform-specific value converters • A PCL with a design-time view model serves design data to all Visual Studio designers (Blend)
  • 45. Conclusion • Portable class libraries are not only for binary reuse • Packaging code as PCLs helps making code cleaner: – Extract interfaces – Unify platform-specific services – Inject service dependencies – Use portable data structures • Consider PCLs when choosing third party libraries – Ready for other platforms – Indication of a proper design – May only have dependencies to other portable libraries • Consider make your next library portable even if you only target a single platform!
  • 46. Resources • Daniel Plaisted «How to Make Portable Class Libraries Work for You» • Scott Hanselman «Cross-Platform Portable Class Libraries with .NET are Happening» Open source projects at GitHub: • AutoFac • MetroLog • Splat • MvvmCross • Simple.OData.Client
  • 47. Thank you! • Mail: vagif.abilov@gmail.com • Twitter: @ooobject • GitHub: object • BitBucket: object • Blog: http://bloggingabout.net/blogs/vagif/default.aspx The source code for this PCL Conformance Analyzer can be found at https://github.com/object/PclAnalyzer