Xamarin: Forms or not to Forms

0

If your starting to look at Xamarin for mobile app development your quickly going to ask yourself one question, should I write my app in Xamarin Forms or regular Xamarin? It’s not as easy of a question as you might guess.

tumblr_inline_mxaqdhiz3J1qzumo9First what is Xamarin Forms? Xamarin Forms is a UI abstraction layer where you write the UI in XAML or C# and it’s translated into corresponding native controls. This is a façade or abstraction allowing for a common, uniformed way to create platform specific controls.

You may think it’s a clear cut case, but as anyone from Xamarin will tell you Xamarin Forms is not the future for all apps. Xamarin Forms will not replace normal UI development, instead it’s a totally different path for different needs.

The one caveat is that Xamarin Forms is very new and is changing all the time. Almost every update will break existing code somewhere and there are bugs that you will run into. Don’t start using Xamarin Forms and expect a mature development platform.

Use Xamarin Forms If:

  • You want a common set of controls that are cross platform
  • You want a common look and feel for your app on all platforms (you can write platform specific UI renders/controls but your going to be fighting the platform)
  • You want a common theme for your app
  • You don’t really want platform specific look and feel
  • You don’t want low level/high customizability controls
  • You don’t want to use the native UI designer for each platform

Xamarin Forms is a great solution for building cross platform data/form centric UI’s, for example Line of Business Applications with CRUD style entry and visualization. For Resgrid Connect app we will be utilizing Xamarin Forms and Xamarin Forms Labs. I’ll be writing about that more in the future as I dive into Xam Forms development.

Resgrid is a SaaS product utilizing Microsoft Azure, providing logistics, management and communication tools to first responder organizations like volunteer fire departments, career fire departments, EMS, search and rescue, CERT, public safety, disaster relief organizations, etc. It was founded in late 2012 by myself and Jason Jarrett (staxmanade).

Generic (and easy) Entity Framework Repository

0

There are plenty of examples of generic Entity Framework repositories out on the world wide web. So why post another? In my searches in the past for generic repo examples I came across a lot of code, a large number of it was old and not compatible with the latest versions of EF. Other examples out there didn’t seem ‘enterprisey’ and more for small apps (in that case I’d just use Massive or Dapper).

metadata-management-repositoryRecently I’ve been talking with people, about Azure and how to use it’s SQL Azure PaaS database, or following good IoC practices and how best to DI entity framework into business or service layer. This now gives me the opportunity to point to a GitHub repo and explain live code people can use.

Last night I pulled out the Repository from Resgrid and put it on Github as Apache 2.0 OSS. Resgrid is a SaaS product utilizing Microsoft Azure, providing logistics, management and communication tools to first responder organizations like volunteer fire departments, career fire departments, EMS, search and rescue, CERT, public safety, disaster relief organizations, etc. It was founded in late 2012 by myself and Jason Jarrett (staxmanade).

Resgrid currently runs:

2 Load Balanced Web Servers (For the public and private site)

2 Load Balanced Web Servers (For our API)

2 Backend (Worker Role) Instances

All of these components utilize this repo and EF to communicate to a single database. Because of the volume and interaction our repository has evolved greatly over the years and will continue to evolve. Resgrid currently sees thousands of hits a day, signs up around 3 departments every weekday and has thousands of app’s hitting our API. In addition to the workers that have jobs that run sometimes every 30 seconds.

Features of the current repository:

  1. Code First & EF6
  2. No code data access (create the POCO, added it to the data context and then just inject GenericRepository<T> into your services/BLL
  3. Synchronous and Async/Await data access calls
  4. Simple API for Updates and Saves
  5. Works with Integer and Guid based ID values

So go check the code out on our GitHub https://github.com/Resgrid/GenericEFRepo feel free to submit PR’s and issues there as well. We intend to keep it updated with the latest versions of EF, performance enhancements and usability as we go forward.

Azure SQL Server V12

0

Recently Microsoft announced that general availability of their V12 Azure SQL servers. In a previous post I wrote about some of the issues I had with the V12 Preview after being forced into it due to issues upgrading my SQL Server.

sql-azureMy primary concern was the ability to utilize DACPAC’s with Azure SQL. This is a very common use case with Azure SQL (in my experience helping other companies utilizing Azure) and with Resgrid. In Microsoft original announcement they noted that CU5 for SQL Server 2014 would fix this issue, it does not. Now on the Azure SQL Plan page they note that CU6 for SQL 2014 works.

 

As noted by muful on this forum post on the Technet forums that the issue that I’ve encountered was due to an errant UDF called [script_deployment_databases] being created in the database. You can verify the existence of this object in your databases by running the query below

SELECT * FROM sys.types WHERE name = 'script_deployment_databases'

I was able see and even rename this UDF, but I could not manually delete it. Installing CU6 for SQL 2014 did not fix the issue. Same error, failed DACPAC Import. So then I installed the Data Tier Application Framework (Feb 2015) both x86 and x64 and tried again and it worked.

So to fix this issue for SQL 2014

  1. Install CU6 for SQL 2014
  2. Install x86 and x64 February 2015 Data-Tier Application Framework
  3. Profit!

Resgrid is a SaaS product utilizing Microsoft Azure, providing logistics, management and communication tools to first responder organizations like volunteer fire departments, career fire departments, EMS, search and rescue, CERT, public safety, disaster relief organizations, etc. It was founded in late 2012 by myself and Jason Jarrett (staxmanade).

Go to Top