PCL Support

Jul 15, 2014 at 6:45 PM
Hi - me again.
Sorry for asking so many questions.

Would it be possible to create a PCL version of VITA?

I am asking that, because we've got a distributed application - server and clients that sync data between MSSQL and SQLite and up to this day, we need to use two different ORMs on server and client. Clients are Android tablets - therefore resource constrained.

So, given I'd implement a SQLite driver, would VITA fit on resource constrained devices as well, or would that make no sense?
Coordinator
Jul 15, 2014 at 7:05 PM
I would be happy to assist you with SQLite driver and make it run on Android, whatever I can do. SQLite is on my todo list as well, I know it is most popular (it not the only one) database on devices. I don't see any problems why it can't work. Removing dependencies on Win32 is not a problem. The only thing I see with SQLite is that it's type system is poor and mostly it uses strings - so there will be some work to adjust for this, especially in LINQ.
Coordinator
Jul 15, 2014 at 7:07 PM
by the way - are you using Xamarin stuff for android?
Jul 16, 2014 at 6:40 AM
yep - using Xamarin for Android and Xamarin for iOS. AWESOME stuff ;-)
Jul 16, 2014 at 11:59 AM
That is also the reason, why we need PCL support.
As you may be right, that in principal every .NET dll is IL code that should be portable between different systems, it seems as if .NET along with all its "sub-frameworks" as silverlight, etc. has diverged. So with PCL, they try to reduce the BCL to a bare minimum that must be supported on all platforms.
For this reason, you do not have "System.IO" for example.
However, in order to have the business logic built only once, we need to keep it im BCLs.

As for SQLite - a major problem with this technology is that its ALTER TABLE statement is very weak. It only supports "Rename Table" and "Add column". Thus in order to rename a column or remove it, you need to
  • select all the tables contents into a new table
  • remove the old table
  • rename the new table to get the old ones name
That is fairly cumbersome and should make it quite complex to get your "migration" stuff to work. :)
Coordinator
Jul 16, 2014 at 4:40 PM
SQLite - yeah, that's cumbersome but completely doable within VITA's schema management. I see more problems with type system - much poorer, and I guess there might be problems with properly translating LINQ.
With PCL - definitely worth a try. I myself preach the minimal dependencies dogma, and always very careful about References list in every project. Vita.Core and Vita.Data DLLs have quite minimalist References lists.
Jul 17, 2014 at 11:40 AM
As to SQLite - we are currently using (as most .NET Xamarin devs do, it is kind of an "industry standard") SQLite.NET
It is kind of a .NET ORM for SQLite but reduced to the bare minimum - so it's just one file full of code. =D
Nevertheless it has proved to be very useful as it has basic LINQ support. (No Joins, no eager loading, etc.) You may want to take a look at it. ;-)