Saturday 15 September 2012

A developer’s introduction to Windows 8


What makes windows 8 different?

Windows is making an aggressive move to the touch and mobile market. Windows 8 is making a clear statement that they are making significant changes to their products and business strategy in an attempt to align to the changing market and their lifestyles.

Some major things that have changed for the end user:
  • The desktop as a home screen has been replaced by a full screen start page based on the options we used to get under the start button (which is no longer available). You can still access the desktop from the start screen but the impression is that this is not the default screen anymore.
  • Your machine and online Windows account are linked. You can buy an application and use it on 5 different devices you have under your user.
  •  Gestures are much more prominent, swipe functions close applications and many other functions that one will typically now expect on tablets or touch phones are implemented throughout the UI. You can use a mouse for the gestures but a touch device would properly feel more natural.
  • Windows now has a store similar to what we have seen with Google Play and the Apple App Store. Being new they have less applications available at this point (A draw back for the end user but an opportunity for developers).
  • It is in fact a hybrid operating system that has the new windows store applications at the other end (It does not run on-top of the desktop but rather from the new start screen with a new user experience) and the backwards compatible classical win32 desktop applications.
 
What does this mean for developers?
                                                                                          

The changes are not purely a new user experience slapped on the same architecture. Microsoft has made this release very noteworthy from both an architectural and development point of view. It challenges many fundamental ideas and this results in a substantial learning curve for current developers in relation to previous releases.

It is important to understand the new strategy and underlying architectural changes as it directly affects how development is done on it. We are going to focus on the new half of the hybrid OS, here are some main highlights:

  • Windows store applications (Formally known as Metro Apps) are completely sandboxed and transparent as to which areas of a device they have access to (Declared in App Manifest and handled by Runtime Broker). This is a great security enhancement but makes the developers’ world more rigid and restricted.


  • As developers, we should understand what WinRT is. Windows has evolved this by creating the WinRT runtime that is placed directly on Windows core as a central source to multiple runtimes. In essence other runtimes are all connected to the same core objects (Windows runtime objects) and just mapped using language projection.
 
  • As developers, we should understand what WinRT offers. WinRT provides developers with a great deal of APIs to use during development. These APIs are basically a collection of libraries that facilitates specific tasks.Here is a list of the categories that are currently available:


  • Although the technology stack is completely different. Microsoft has made a considerable effort to make use of developers existing skill sets to create Windows store applications. The following languages can be used:
  • XAML/C# (Will look very familiar to people with WPF & Silverlight experience)
  • HTML5/CSS3 (Using IE10 engine + WinJS)
  • XAML/C++ (Native and unmanaged)
  • DirectX/C++ (Native and unmanaged)


  • Apps will be required to pass Microsoft testing based on set of criteria before being  allowing it on the market. This means you need to know the design guides, understand the application lifecycle, available layouts and orientations before you can start any serious development.
 
  • Plan for data persistence. Because the application runs in a sandboxed mode you need to plan how to persist data and state. As you cannot directly connect to SQL embedded DB or ADO.NET you might need to connect to a service exposing a database or to the cloud. There are three states that you can use:
  • Session State
  • Local App State
  • Roaming App State
  • Know you are developing an asynchronous application. If in .NET 4.5 you have task dependencies they need to be defined as such. This might be a bit more tedious in design but decreases the risk of a complete application crash when only one thread is blocked. Apart from that this allows for more interactive control as required with multi-touch input and more.

Complete overview of Windows 8 Technology Stack:



 
Getting the environment up

If you have read up and you are ready to try some development, I suggest creating a VirtualBox DEV environment. If you are like me you might not want it as your primary OS yet.

*Requires MSDN Subscription or valid license

Suggest you kick off by doing one of the following tutorials:

Recommended Online Resources


*Please note that this information comes from various online resources and research. The only diagram I am responsible for is the circular diagram explaining the available development languages in relation to WinRT.


No comments:

Post a Comment