A quick overview of XPO in Xamarin.
With the current release of XPO v18.1, DevExpress has made XPO available free-of-charge. Xamarin has been open source and free for quite some time, and now with XPO for .NET Core / .NET Standard 2.0 finally out of Beta, a world of possibilities and new exciting features/projects is opening to us.
Let’s review what exactly that means to us.
If you have used XPO in the past you know the great features it offers:
- Transparent and Controllable Object Relational Mapping System
- Bindable and Pageable Object Collections
- Support for various DB engines (14 to be exact and you can always implement your own XPO connection provider)
- Advanced Criteria System
- And More…
Also, it is a mature product with great support that has been around for 15 years. Support is still a paid service but definitely worth it (ask around). Want to see how it compares to EF? Just take a quick look at this simple benchmark.
Convinced enough to give it a spin? If you are new to XPO and you want to learn more about it, just follow this link and start playing with it, but if you have used it, in the past, you already know how flexible XPO can be and how it manages a lot of the cumbersome backend plumbing for us. With its release for .Net Core now, it became available in Linux, Mac Os, Windows, and it targets Web (ASP.Net), desktop (Windows Forms, WPF) and more important for the topic of this article, mobile (XAMARIN). Don Wibier gives an excellent introduction to Net Core in Xamarin here.
Now, before I move to Xamarin, I want to give a shout out to my friend Joche Ojeda who has been doing an incredible job in this field, more to that in a bit. But as a teasing, if you want to understand more of the XPO architecture or take a look behind the hood, go and check out his series DevExpress XPO from 1 to N.
Xamarin besides some quirks at the beginning has gotten a lot of traction, with incredible support from Microsoft, a more than ever growing community and I can say that even Xamarin Forms it is a mature product today (I know it has been a lot of heated debate about this affirmation, but I still stand behind it) . With beautiful UIs and native performance, it should be the go-to for any C# developer.
If you are just starting in Xamarin, I would recommend a great article by Charlin Agramonte: Learning Xamarin Forms – The XamGirl personal recipe and Xamarin University also offers a Free Account tier which includes access to all of the Self-Guided Learning courses, Guest Lectures, and Lightning Lectures for an unlimited time. You can start a free account here.
Two mature products? Is that the magic recipe? Well, we are in the beginning phases, but I have a lot of hopes for this two working together, and even if we have a long way to go, we can already do really interesting things. Let me share with you some tips and links to help you be up and running as fast as possible.
First:
- How to obtain the XPO library. Follow this to the point instructions; it won’t take you more than 10 min.
- Want to use SQLite? Let’s crawl first and then walk (We will be running pretty soon) At the moment of writing this article, we still have to install a lot of dependecies and nugets to make SQLite work with XPO in Xamarin , thankfully there is already a nuget that avoid us all the pain of going one by one and setting it up.
- Love XpCollections? Love ObservableRangeCollection? Need Pagination? We got you covered.
BIT.Xpo.Observables Nuget provides an observable implementation of XpCollection and XPPageSelector.
If you check all of those links. Going back to my point above, well, thanks Joche!
Ok, I don’t want to make this article super long because I am planing to take it apart and make more concrete samples and demo projects, but before I go I just want to leave you with amazing news and a really cool concept/idea.
First, the Logify client for Xamarin has been out for two weeks now. That means that you can have all your crashing monitoring in a single place for desktop, web, and mobile. Pretty neat right?
So in summary, what is on the horizon for XPO and Xamarin:
- XPO and Database Replication
- ViewModels Simplification (This topic deserves its own article).
- XPO Observable Collection (as seen above)
- XPO Odata V4 services with Web Api
- XAF as a great backend for Xamarin
- XAF + XPO + XAMARIN + AZURE
- And More to come…
Of course, I want to hear from you. Any cool projects/idea with XPO and Xamarin?
Until next time. So much to do. Will be back soon for sure. Xpo Out!
Very good topic Jose,
Can’t wait for the XAF as backend for Xamarin demo, please continue to good work.