New Workshop! Developing Modern User Interfaces Using WinRT

I am offering a new workshop that is dedicated to developing Windows Store Apps using WinRT and related technologies such as HTML, JavaScript, CSS, XAML and C#. The workshop is intended for people who want to find out whether Windows Store Apps are a good option for your application development in addition to or instead of desktop/web application development. It takes 1 or 2 days depending on your needs and offers insights to the exiting world of Windows Store App development.

You can find more details here (German only).

HTML5 with JavaScript and CSS3 Specialist

As part of continuously maintaining my certifications, I passed the exam Programming in HTML5 with JavaScript and CSS3.
Although a lot of developers think that JavaScript is a poor programming language compared to Java or C#, mainly due to it’s weak typing and limited IDE support, it is impressive to see what you can do with it. The main key to understanding is to abandon the notion that JavaScript is an OO language. The name JavaScript is really misleading as it implies that JavaScript is close to Java. But beside the curly braces there is not much common ground.

By passing the exam I achieved the additional certification Programming in HTML5 with JavaScript and CSS3 Specialist

HTML5 Geolocation

Recently I’ve been playing with HTML5 features just to see what it can do in the area of Rich Internet Applications (RIA).

Especially geolocation, local storage and application caching got my attention.
As I don’t think privacy is a concept of the past, I thought it would be a nice use case to track a persons location and store it locally.
So I created a little Location Tracker App to show those features in action.

The required browser features are not supported on all desktop browsers. But due to the fact that most mobile webbrowsers are based on Webkit, it runs on almost any mobile device. (Using a location tracker on a fixed PC seems to be of limited use anyway ;-))

It is amazing to see what you can do with HTML5, Modernizr, KnockoutJS, jQuery and a few lines of JavaScript. For me HTML5 is an interesting option especially for mobile devices.

Scrum and Silverlight in Reinsurance

Today I would like to share a success story of a project I accompanied as Scrum Coach and Solution Architect from analysis to production.

Main success factors were:

  • Scrum (Agile Development)
  • Cross functional Team
  • Service-oriented Design (SOA)
  • Silverlight RIA

You can read more in the case study Modernization of business partner management.

RIA goes to Hollywood

Most RIA technologies today use an asynchronous model to communicate with the server, primarily to keep the UI responsive no matter what the server is doing. This principle is also known as the Hollywood principle. Don’t call us, we call you means that instead of continuously polling, the server calls back when the operation finished. In order to be notified when the server finished its job, callbacks are used.

For instance in Silverlight this leads to code like this

void ClickLoad()
{
    LoadCustomer(1,
    (result) =>
    {
        // Process result
    },
    (error) =>
    {
        // Process error
    });
}

void LoadCustomer(int id, Action<Customer> success, Action<Exception> error)
{
    LoadFromServer("select * from customers where id = " + id,
    (result) =>
    {
        success(result[0] as Customer);
    },
    (exp) =>
    {
         error(exp);
    });
}

void LoadFromServer(string query, Action<List<object>> success, Action<Exception> error)
{
    server.LoadCompleted += (s, e) =>
    {
        if (e.Error != null)
            error(e.Error);
        else
            success(e.Data);
    };

    server.LoadAsync(query);
}

Not very nice, is it? In jquery we find a similar pattern.

$.ajax({
  url: 'ajax/load.html',
  data: "query=1"
  success: function(result) {
    // Process result
  }
  error: function(XMLHttpRequest, textStatus, errorThrown) {
    // Process error
  }
});

Usually an application consists of several layers. In that case the callbacks have to be routed back to the original caller, leading to code that is neither easy to read nor easy to maintain.

From what is already visible, it is very likely that Silverlight and WinRT are going to have great overlap. The combination of XAML, C# and WinRT plus the tooling will be very familiar to all Silverlight users.
That means, it is likely that the asynchronous programming model will be the predominant model for client/server communication for Windows Metro style apps. In order to simplify this, C#5.0 is going to include the await/async keywords, that will make callback chaining obsolete.

Example:


void ClickLoad()
{
    try
    {
        Customer result = await LoadCustomer(1);
        // Process result
    }
    catch(Exception e)
    {
        // Process error
    }
}

async Task<Customer> LoadCustomer(int id)
{
    List<object> result = await LoadFromServer("select * from customers where id = " + id);
    return result[0] as Customer;
}

async Task<List<object>> LoadFromServer(string query)
{
    return await server.LoadAsync(query);
}

This is much cleaner than the examples above. Actually it is a synchronous programming model supporting an asynchronous runtime model. As asynchronous calls are very common in RIA applications the async/await keywords are going to change the way we program async calls in the near future, leading to code that is easier to develop and maintain.

I can’t await async in C# 5.0 😉

Polyglot Workflows with Activiti and Silverlight

My latest article Polyglot Workflows with Activiti and Silverlight has been published in the current issue of JavaSPEKTRUM. After losts of  theory in form of articles and conference sessions, I thought it would be a good idea to present a real example.  The Activiti engine is an interesting product in the area of BPM. If you go beyond simple demo applications you might want to integrate it with existing UIs, such as corporate portals. Silverlight is an interesting candidate for this task. The article focuses mainly on the interoperability aspects of Activiti and Silverlight and shows how easy it is to bring both together.

New Silverlight BPMN Tool

The IYOPRO Process Modeler is SaS solution to model business processes over the internet. While several tools like this are avaliable, this one is especially interesting as it combines BPMN and Silverlight, a strong modeling standard and a powerful RIA technology. It looks and feels like a desktop application and is fun to play with.
In some areas it is limited (e.g. no export) but it is worth to try and see how it evolves in the future.
What I like is the capability to visually simulate processes and the timeline view. This can give you insights about the process flow at runtime.

Wide or Deep? – That is the Question

There has been some discussion over the last months about the future of Silverlight and it’s role especially compared to HTML 5. This question is regularly asked in my Silverlight workshops as well, so it is time to shed some light on it.
To me it seems that essentially the question is whether you would like to go wide or deep.

Joey deVilla coined the terms in his blog post Silverlight, HTML5, The Web, The Phone and All That

Wide means reaching potentially every user on the planet.
Currently the only technology capable of doing that is HTML 4.1 (+ CSS + JavaScript of course). Not HTML 5 because it is not yet there. Neither finally specified nor fully implemented in all major browsers. (check HTMLTest for your browser compliance). Not mobile Apps cause there is no dominant platform yet. (Will there ever be one?) Even if a mobile platform, such as Android, had a market share of 50% a mobile App would only reach 50% of the mobile devices.

Deep means creating compelling user experiences in terms of performance, interactivity and usability. This is usually expected for line of business applications (LOB). Those applications run in corporate environments and target at power users who work with the applications on a daily basis. Here Silverlight is a great option. It reaches far beyond .NET as it can be combined with almost every backend technology via standard protocols.

Here are some quotes from related blogs to underpin this view:

With the blossoming of Silverlight, I think we finally get the best of both worlds when it comes to LOB – the ubiquity of the browser, the rich experience, the online and offline scenarios, and the great languages and tooling.
Jonathan Allen on InfoQ

Web devs never picked up Silverlight as their platform of choice. They always stayed close to what they felt most comfortable with – JS, HTML, CSS, AJAX. Sure, they suffered from cross-browser issues due to the fact that every browser has its take on how “standard” features should be implemented, but they stayed true to pure web development and never embraced Flash or Silverlight.
Vassil Terziev on Telerik blog

Silverlight will become dead if and only the hundreds of thousands or millions of devs who are doing desktop apps today decide that writing JavaScript is cool and that they can achieve more with HTML5-capable browsers, tooling and platforms than with Silverlight or some other similar technology. I honestly don’t see that happening, though, and believe in the merits of SL when it comes to development of heavy-duty LOB apps for the Enterprise.
Vassil Terziev on Telerik blog

In short, if you want to go wide use HTML, if you want to go deep use Silverlight.

I know that this is a bit of a simplification as other factors affect technology decisions as well. Actually is not the technology that comes first. Technology decisions should follow business requirements. And sometimes it is even a combination of technologies that produces a great solution.
But maybe the wide or deep question might help to find the best technology for your requirements.

Silverlight Receives Technology of the Year Award

InfoWorld rates Silverlight the best rich internet application platform in 2011.

Quote:

“Right now, we favor Silverlight. In the two categories most important to decision makers — developer tools and design integration – Silverlight trumps Flash/AIR/Flex. The toolset in Microsoft Visual Studio 2010 is demonstrably excellent, and Microsoft Expression Blend bridges the design-development gap much better than Adobe Flash Catalyst. For these reasons, companies like Netflix have chosen Silverlight as their RIA technology. We completely agree.”

Of course such a rating always depends on what is important in a certain context, but it shows that Silveright is definitely one of the leading technologies in the RIA space. Beside many other aspects the toolset is very important, as it helps to boost developer productivity.

I can only confirm that. We are currently using Silverlight in an Scrum project applying an incremental design and agile specification approach. Silverlight is ideal in this context as the toolset supports all phases from sketch, specification, design, development and test in a flexible manner. Business analysts, designers, developers and testers are able to work closely together using the same toolset.

Silverlight in NoMicrosoft Environments

According to the term NoSQL (not only SQL), NoMicrosoft or NoMS stands for heterogeneous environments in which Microsoft technology is not the dominant platform. For instance many companies use JEE and Unix-based backends and Windows desktops to run their line of business applications.

For those wondering whether Silveright makes sense in those environments, I recommend looking at eBay. A while ago they created the eBay Simple Lister App which can be installed from eBay Garden. This app combines great user experience with a web based deployment model. It is based on Silverlight and integrates with existing Java-based eBay services via JSON/POX and REST. It makes use of unique Silverlight features such as WebCam and notification windows just to name a few.

Another good example is Facedeck, a Silverlight frontend for Facebook. If you don’t wan’t to install it, you can watch a video on YouTube.

From what I see, developers and decision makers start realizing that by using Silverlight they can create compelling user interfaces and achieve great developer productivity especially for line of business applications. Due to its standards support and interoperability features Silverlight is not limited to .NET-backends but well suited for all kinds of backends including Java/JEE.

Some features especially useful in NoMicrosoft environments are:

  • Standards based interoperability via SOAP, REST, JSON, ATOM, POX, OData, XML Schema
  • MSBuild can be fully integrated with Maven and Hudson
  • Silverlight apps can be hosted on any webserver including Tomcat and Jetty
  • Free development tools (Visual Studio Express)
  • Free automated unit testing (Silverlight Toolkit and NUnit)
  • Automated UI testing using WebAii or HP Quicktest
  • No licence cost

If you are interested to see all those feature in action please drop me a note.