CSLA PCL

CSLA PCL

Old forum URL: forums.lhotka.net/forums/t/12853.aspx


Shritama posted on Tuesday, March 24, 2015

Hi,

I am building a Xamarin.forms apps using PCL. I would like to know when to expect the CSLA Universal PCL that can be used across all apps and Web.

Thanks

S

 

ajj3085 replied on Tuesday, March 24, 2015

You should be able to use Csla now without PCL for all apps and web.  What you wouldn't be able to do is reference Csla from other PCL libraries (PCLs may only reference other PCLs).  I'm curious what requirement you have that necessitates PCL.

JonnyBee replied on Wednesday, March 25, 2015

Hi,

There is PCL libraries in CSLA-Core Nuget package. 

The wpa (Windows Phone AppX) is a Universal PCL library that target Windows Phone 8.1

 

 

 

Shritama replied on Wednesday, March 25, 2015

Hi,

Here my scenario is we have a WPF application. We are taking the Business Objects from there from the WPF app. Now in Xamarin forms we have a PCL which we are using as shared. Android, IOS and Web application will be referencing to that. So all the view models will be shared across the applications only separate view is required.

Thanks,

Shri

 

ajj3085 replied on Wednesday, March 25, 2015

Shritama
Here my scenario is we have a WPF application. We are taking the Business Objects from there from the WPF app. Now in Xamarin forms we have a PCL which we are using as shared. Android, IOS and Web application will be referencing to that. So all the view models will be shared across the applications only separate view is required.

Sounds like there is a PCL version now, but you could also create a VS Shared Project type project to accomplish pretty much the same thing.  this extension adds support for it https://visualstudiogallery.msdn.microsoft.com/315c13a7-2787-4f57-bdf7-adae6ed54450

RockfordLhotka replied on Wednesday, May 20, 2015

I've discussed the pros and cons of a PCL before, and it isn't an easy tradeoff.

Because CSLA contains optimized code for some of the platforms (most notably full .NET vs some of the other platforms), and a PCL allows you exactly one implementation, if I created a PCL version of CSLA it would have to only use the non-optimized code - that is only code that runs everywhere, and not optimized for full .NET (like on a server).

Alternately I could create a PCL that is a shell, and the PCL would delegate all calls to platform-specific assemblies. This would work only for people using NuGet, or people who were up for creating their own pre-build scripts in VS and deployment scripts to ensure the appropriate satellite assemblies for each platform were deployed as necessary.

None of this is to say that I _won't_ create a PCL at some point - just that it won't be a panacea, and there'll still be very good reasons to use a platform-native implementation instead. Especially on servers where the full .NET optimizations would make the biggest difference.

Copyright (c) Marimer LLC