Getting the project underway

Well it is time to start creating the application. After the problems detailed in the last post we will not currently be using the Azure Tools.

That said there are a few things we need to download.

Visual Studio 2010 (http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx)

WCF RIA Services (http://silverlight.net/getstarted/riaservices/)

Install both of those.

Start Visual Studio 2010

Select File, New Project – in the list of Installed Templates to the left, select the Silverlight option. to use the WCF RIA Services DomainService template we need to make sure .Net Framework 4 is selected in the .Net Framework pulldown. If it is not selected then the WCF RIA Services Class Library is not listed and this is required later to provide the Middle and Back-end tiers of the app.

When you do this you will find a number of templates – some of which are new to Silverlight development.

  • Silverlight Application
  • Silverlight Business Application
  • Silverlight Class Application
  • Silverlight Navigation Application
  • Silverlight Unit Test Application
  • WCF RIA Services Class Library

I’m not doing to use them but the Business Appliction and Navigation Applicaton deserve some consideration. One of the latest additions is the ability to allow the user to use the Back button of the browser in Navigating the application. This is achieved by using the Navigation Application template and it provides a way of allowing different pages of an application to be created and navigated around.

The Business Application is the virtually the same but in addition to a Silverlight application it also includes a WCF RIA Services Class to provide the database backend. On the face of it this would seem the ideal candidate for my application. However my app is a single page with drag and drop functionality – I really don’t want extras in the app that are not required. For this reason I am going to create my Silverlight Application from scratch and set up the reference links between them manually.

First off is to create the Silverlight Application. Now a Silverlight Solution consists in the first instance of two projects – The Silverlight application itself and a web application to host it.

  • Select Silverlight Application template
  • In the New Silverlight Application Window there is a checkbox labelled ‘Host the Silverlight application in a new Web site’. As this is a new solution we want this checked. If you were adding this project to an existing solution you do get the option to add Silverlight to the app, but in this instance we can keep it clicked
  • The next option of interest is the Silverlight version. For Visual Studio 2010 it will default to Silverlight 4 which I want to use.
  • The Final option Enable RIA Services also needs to be checked. Now although this does not refer to WCF RIA Services – RIA Services was renamed to refer to it and in reality there are effectively the same thing.

That gets the initial project created, clicking on OK allows Visual Studio to go away and create all of the projects and links required for the application. Now it is time for the Middle and Back End Tiers.

  • Click on the Solution in the Solution Explorer,
  • Right Click and then Select Add, New Project
  • Select the WCF RIA Services Class Library
  • Give it a name
  • Then Click on OK

Again Visual Studio goes on to create the projects. When it is finished you will have a new folder which contains two projects; one ending in .Web which contains an empty class and another project.

So having created the RIA Class project you should have the a Services Library containing two folders, a Silverlight Application Project and a Web Project. Now is the time to wire up the refences between the Middle/Back Tier and the Silverlight Application.

Right Click on the Silverlight Host Website References and Select the project option. Select the WCF RIA Services Web Host

Right Click on the Silverlight Application References and Select the project option. Now select the WCF RIA Services Class.

When this is done you should have something like the following setup;

So there we have it. The project is now created, we have linked the Backend. Time to get writing some code.

Bad language which would make your Granny’s toes curl

I’ve just spent ages setting up the initial application, only to find I cannot link the database backend to the front – because Azure does not support .Net 4.0 yet.

Why use .Net 4.0, 3.5 does support ADO.Net Entity Data Model? Well I can create the Entity model, but I can’t create the associated Domain Service. This is the bit I want and will provide the Data Access/Business Rules layer.

The first time I knew there was an issue was when trying to link the Silverlight Client Application, to the WCF Ria Services backend. Visual Studio kept moaning that the backend was a higher Framework than the client. Huh? I created .Net 4 projects what is it talking about?

It seems that when you create an Azure project in .Net 4.0 the template aware Azure does not yet support that .Net version, changes it to .Net 3.5!

If you are using C# you can check the target framework from the properties of a project.

  • Right click on the Project within the Solution Explorer.
  • Select the Properties option in the popup menu.
  • Select the ‘Application’ Tab from the left

After a lot of google (try as I might I still find better results with Google than Bing – so at the moment Google is my search engine of choice but I kind of prefer the display of Bing) and even more cursing –  I eventually found this – http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/f9fd7247-0893-447e-bb5a-494bc9543e8a – which would indicate it is coming, but only when VS2010 goes from Beta to Live – this should be April this year according to http://blogs.zdnet.com/microsoft/?p=4981

As it is possible to use convert standard applications to Azure – that is what I am going to do. Develop an application as a standard Web Application – and then convert for running under Azure when .Net 4.0 support is available.

How Apple has blown it with the iPad

As a 20 year Microsoft developer you might expect me to be anti-Apple but far from it. Apple kit has always been well designed, but back in the early days of the PC apple had a really big chance to define the PC and it blew it. While Bill Gates made probably the best deal in business history with MS-DOS and the design of the PC evolved into an open platform. Apple blew it by closing off development with the Mac. and the rest as they say is History.

Apple have not learnt.

This last week saw the release of the new iPad. And what a sexy good looking bit of kit it is. To be perfectly honest the tech geek in me was drooling. This a bit of kit I could see me using and wow would my app look good on it. Then reality raised it’s boring head.

Apple control things so that you have to get ‘approval’, only certain apps are allowed and one of the biggest ones missing is Flash. OK my final site will not run on Flash – but a large chunk of the web does. That means I’m going to go around with great lumps taken out of a page because not only do you not have Flash you can’t install it if you wanted to.

If I want to develop software for my Blackberry RIM make it really easy – I can go to the Blackberry site and download a library that works with Visual Studio for the some total of absolute nothing – as I already have a PC, and I already have Visual Studio I can be developing Blackberry Apps in a few minutes and an outlay of absolute nothing.

For the Apple, nope – OK they launched an SDK but I can’t see a way of installing it on my PC. So that means an Apple Mac – don’t get me wrong – all things being equal I would much rather the MacBook Air on my desk than the boring PC Laptop – but businesses use PC’s so I do.

My outlay then is going to be at least £1000 before I can’t start developing for the iPad – and that is before I have bought the iPad!

Which means for this development I will wait before developing a version of the iPad no matter how sexy it looks. Vodaphone, who I use for my mobile phone will be providing the iPhone soon so when my current contract runs out I will no doubt get one; but development will have to wait until the application starts making money. Now how many other developers are going to make the same economic decision. The closed eco-system of Apple strikes again. Apple if you really want to make inroads into Microsoft – open things up a little.

The closed environment of the Apple strikes again

Introduction

I’ve been working with Microsoft Azure while it has been in Beta. I like the idea of Azure. For the small single developer being able to host a site at relatively low cost allows me to develop on-line applications and for my hosting to grow with the requirements of the application – rather than a steep upfront cost.

The internet today is a treasure trove of APIs which provides the developer with a lot of opportunity to develop functionality. The application I am working on will provide a one-stop site that integrates a host of tools to help the small businessman, including accounts, Contact Management, diary, statatory returns; integration with IM. Above this I will also be adding a series of Web Services; allowing 3rd Party developers to create tools – meaning that the portal information can be made available from stand-alone apps, MS Office applications, your iPhone, Blackberry or Mobile phone.

By the time I’m finished this should detail the technical, and practical issues that arise in getting an application from writing the initial code to getting it to market.