Does Xamarin have a future?

Xamarin‘s cross-platform mobile application framework has Xamarin.iOS and Xamarin.Android at its core. Both Xamarin.Android and Xamarin.iOS are based on Mono. Mono is an open source implementation of .NET (CLI and CLS). Xamarin’s customers are Microsoft (.NET) shops. Microsoft is open sourcing .NET itself. What does all this mean for Xamarin?

Is Xamarin’s competitive advantage going to be undermined by the open source .NET? Microsoft’s Universal Application Platform (UAP) and the promise of making .NET applications run on Mac and Linux seems to indicate that Microsoft may be emerging as a threat to Xamarin.

The formidable Microsoft has perhaps spelled death for Xamarin by standing up a competitor to Mono. If you are a developer getting started with Xamarin or already using Xamarin, should you be worried? After all Xamarin has a significant learning curve. Just because you are proficient with C# and Visual Studio does not mean that learning curve of cross-platform development with Xamarin is insignificant. I have worked with Xamarin platform for more than two years. As you get into Xamarin development, you quickly realize that you need to know and learn quite a lot about the platforms that you are developing for. So, should you put your time and money into Xamarin? Should you (continue to) invest in Xamarin? Does Xamarin have a future?

Xamarin’s core competitive advantage is not in competition with the (.NET Core) class libraries, SDKs and server frameworks being open sourced by Microsoft. Xamarin’s competitive advantage is in the ecosystem of development and testing tools as well as infrastructure that supports cross-platform mobile development, testing and monitoring. Xamarin marvelously simplifies creation of native apps on iOS and Android using C# (now F# also). The pace of innovation at Xamarin is breathtaking. There is nothing quite like it to enable cross-platform development of native mobile applications with Microsoft’s flagship programming language at its core and the incredible productivity allowed by Microsoft’s and 3rd party tool set.

I think both Microsoft and Xamarin are going to greatly benefit from the formation of .NET Foundation and open sourcing of .NET as well as cross-platform implementation of .NET. Keep in mind that while Mono is open source, Xamarin.Android and Xamarin.iOS are commercial products. Xamarin is going to benefit immensely by Mono closing the gaps with .NET BCL implementation and converged implementations of Mono and .NET in the near future, without giving up its core competitive advantages. Microsoft has seen the writing on the wall – The future belongs to Cloud and Mobile. Microsoft has a strong presence in Cloud, but not so much in Mobile. Microsoft is going to benefit from .NET running on Mac and Linux by expanding their customer base to those platforms in its cloud offerings in Azure. But Xamarin’s gains are also going to translate into broader and deeper mobile market penetration for Microsoft’s tools and technologies, benefiting Microsoft’s Cloud strategy even further. Xamarin’s success is strategically important to Microsoft. Now even more so.

I think that Xamarin will continue to gain strength and remain a viable cross-platform development framework as far as I can see. Xamarin’s future looks very bright to me.

Understanding and Using System.Transactions

These are some resources to help grasp System.Transactions functionality and use it effectively in your projects:

Features Provided by System.Transactions
http://msdn.microsoft.com/en-us/library/vstudio/ee818755(v=vs.100).aspx
Implementing an Implicit Transaction using Transaction Scope
http://msdn.microsoft.com/en-us/library/vstudio/ee818746(v=vs.100).aspx
MSDN Articles by John Papa
ADO.NET and System.Transactions
http://msdn.microsoft.com/en-us/magazine/cc163847.aspx
Revisiting System.Transactions
http://msdn.microsoft.com/en-us/magazine/cc163527.aspx
These are specific to TransactionScope (the way to go in most cases)
Here is a practical example of Using TransactionScope :
http://thewayofcode.wordpress.com/2011/12/11/handling-transactions-in-net-using-transactionscope/
This one gets in depth with the way a TransactionScope like functionality can be implemented. Gives you a good understanding of what is happening under the hood when using TransactionScope in some Repository implementations in multi-threaded scenarios.
http://msdn.microsoft.com/en-us/magazine/cc300805.aspx
Here is another example of implementing a transactional repository :
http://www.codeproject.com/Articles/31270/A-Transactional-Repository-Implementation-in-NET
There are excellent tips here about configuring TransactionScope when used with SQL Server:
http://blogs.msdn.com/b/dbrowne/archive/2010/06/03/using-new-transactionscope-considered-harmful.aspx
This is a good resource for CommitableTransaction usage – http://www.codeproject.com/Articles/55472/Committable-Transactions-in-C-SQL
And this one has brilliant under-the-hood coverage – http://www.codeproject.com/Articles/35087/Truly-Understanding-NET-Transactions-and-WCF-Impl

RIA with Silverlight and WCF – Los Angeles .NET Developers Group

 

I will be attending Jason Beres’ “RIA with Silverlight and WCF” lecture on Saturday the 4th. Check-out the details here : Los Angeles .NET Developers Group. Let me know If you are planning to be there. It will be a great opportunity to meet.

Dial Gauge is a ProgressBar

I am not just being philosophical here. In WPF, ControlTemplates allow you to transform a control’s appearance. This is not the same as applying stylesheets. This is an entirely new level of customization. What you see in the screenshot below looks like a Dial but is actually a simple ProgressBar control wearing a “Dial” template. The Dial template was created using Microsoft Expression Blend .

dial-is-a-progressbar.PNG

Include the ControlTemplate as a Window.Resource and then assign it to ProgressBar element’s Template attribute :

         

Of course that is not all. The ControlTemplate must define some named elements of FrameworkElement type. Charles Petzold has explained it in detail : MSDN Magazine Article. So, I will not repeat it here.

The sample code can be downloaded here : DialTest.zip
License : Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

WPF – LINQ to SQL Sample

This exercise in binding a WPF ListView control with LINQ to SQL was a lot of fun ! The following image shows data from AdventureWorks sample database displayed in the ListView control. The end result is very admirable, even in this very basic demo. Feeling a complete sense of freedom is unavoidable when working with WPF.

Linq2SqlSample1.Png

This sample demonstrates :

  1. LINQ to SQL mapping.
  2. WPF ListView Control DataBinding.
  3. Displaying images stored in database as varbinary in WPF control.

The sample code can be downloaded here : WPF-LINQ to SQL Sample
License : Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Creative Commons License