When Written: Oct 2012
The big news from Microsoft has obviously been the release of Windows 8 and their tablet device. This new operating system heavily uses touch as a way of interacting between the user and the apps, and while there are and still will be traditional Windows applications there has already been a major shift in the way future Windows apps will be created.
With these new applications Microsoft see data playing a larger role in the future., In fact according to Eric Schmidt, CEO of Google, more data is generated every two days than was generated from the dawn of man until 2009; this is an incredible statement and whether it is correct or not is largely irrelevant, the fact is that more and more data is certainly being produced and the ways of accessing this data are becoming ever more varied and easier. This new generation of applications, because they will be accessing this data that is held in a variety of places sometimes over unreliable or slow connections, should be written in such a way that they will talk asynchronously with any data sources either locally or out on the internet. By using asynchronous communication rather than synchronous, the application will remain responsive to the users interaction as the data is fetched in the background. With the more traditional synchronous method of getting data the applications will pause until the data fetch is complete and so will appear to hang; we have all experienced this and it makes the application frustrating to use. All this has been possible in the past but with the release of .NET 4.5 and Visual studio 2012 things have got a lot easier. For example, the simplest method now of calling asynchronously is:
Dim urlContents As String = Await client.GetStringAsync()
What the new Await command does is suspend the execution of the current method until the awaited task is complete, but in the meantime it also returns control to the caller routine of that method and so your program can continue to run, so there is no impression of it ‘hanging’ whilst this data is fetched. The normal way to build a data based web application now is to build a webservice that accesses the database and then to query this webservice from within your web application. For accessing and consuming data to create this webservice which your application can then use, there is a new and better version of the Entity Framework which I shall be covering in another issue. One of the new features of this is the ease with which the framework can be updated when the data structure changes, even with live data. Previous versions required you to drop the database objects and re-create them, which is bad news for a live web site, but thankfully this is now fixed along with several other bugs.
Microsoft are calling this new generation of applications that they expect to be created ‘Modern Applications’ though quite what we will call the next generation in a year or so’s time is anyone’s guess, ‘More Modern Applications’ perhaps?
Article by: Mark Newton
Published in: Mark Newton