So What’s a Web Application Now?


Since this is likely to be the first question posed at the upcoming “Future of Web Applications” panel at TechEd NZ, I thought I’d do a bit of digging and discovered it’s not as clear as I perhaps thought.

Here’s a sample of what I found.

About.com define web applications in the context of browsers,

A web application is any application that uses a web browser as a client.

Back in 2000, Dave Winer took this further and defined a two different sorts of web applications,

Simply, there are two kinds of Web sites, those that behave like magazines, places where you read stuff; and sites that behave like software, places where you go to do stuff.

Dave also defines web applications as being entirely defined in the context of a web browser. He makes the good distinction between web sites that primarily provide access to information – sometimes called brochureware sites – and applications that deliver functionality and with which you interact more than simply browsing – good examples of this include Xero (disclaimer – cheap, but relevant, plug for the company I’m working for), Gmail, Google Docs and heaps of others.

In fact, ever more interactive web applications have taken off in recent years. With the power of javascript libraries such as jQuery and Sencha and technologies like Ajax it’s now possible to build incredibly rich web applications that work across a multiple browsers and platforms.

But I think we’ve come to the point where we need to broaden this definition.

Wikipedia takes a more general definition and also one that reflects more recent advances in web applications.

A web application is an application that is accessed over a network such as the Internet or an intranet.

However, reading the rest of the article it’s clear Wikipedia still assumes that web applications are always delivered via a web browser. But technologies such as Silverlight, Flash Air have changed the way I’ve looked at web applications.

I’ve written earlier about how the convergence of Silverlight, Silverlight Out-of-Browser and WPF applications is making it more difficult to define exactly what a web application is. I use Silverlight applications that were initially accessed over the internet from a browser but are now only ever accessed from an icon on my desktop and run, in many ways, like a traditional desktop application. They still access services and data over the internet but make use of local processing power to drive the user interface and application logic. Are they web applications?

Perhaps we are seeing the technology cycle in action and are returning to the days of client-server or even mainframe applications where the internet and cloud provide the data/services for an increasingly rich set of applications – are the days of the thin client numbered?

I think I’ve managed to confuse myself – so what is a web application now?

author: Tokes | posted @ Sunday, August 22, 2010 9:41 PM | Feedback (0)

The Web’s Not Dead But the Times Are a Changing


Great article from Chris Anderson and Michael Wolff at Wired discussing the way in which our use of the Internet is changing. The way in which we are accessing data and services over the internet is definitely changing. If I think about the applications I’m using at the moment,

  • TweetDeck (Adobe Air)
  • Yammer Client (Adobe Air)
  • Gmail/Google Reader (access via Chrome application shortcuts)
  • Podcast Downloader (Silverlight) – to download multiple GoogleReader podcasts quickly to my desktop
  • Uber Twitter - Blackberry Twitter Client, yes I use a BlackBerry @ work, I’m not proud of it but it came with the job!
  • Foursquare for the Blackberry – not really using this much but wanted to give it a go to be able to talk with the cool kids
  • Blackbery email client

I probably spend more time in these apps than I do in browser apps and when I buy a WP7 device later in the year (to freak out all the Apple fanboys I work with ;-) but also cause I reckon it looks really cool) I’ll be using even more native apps. And I won’t be alone as the mobile wave continues to increase as expected even more applications will be delivered to mobile devices and HTML based applications simply don’t offer the richness of presentation or access to local resources (camera, GPS, local storage…) and processing that we need.

Love that we’re in the middle of such change – bring  it on!

author: Tokes | posted @ Wednesday, August 18, 2010 10:00 PM | Feedback (8)

Off to TechEd…


Excellent – off to TechEd again this year with a great slot sitting on a Panel discussing the future of Web Applications. I’ll be posting a few brain-dumps over the next few weeks to give you an idea of the sorts of thoughts flying around my head – am looking forward to hearing what the other panel members and the audience have to say.

We’re all surrounded by what’s cool and relevant now so this is an opportunity to star-gaze and imaging what things will look like in 1,2 or 5 years time. What is a web application anyway? Is my desktop twitter client a web application? What about applications that will run on my television? All interesting stuff.

The Future of Web Applications - Panel Discussion

Track: Web & User Experience

Speaker(s): Adrian Krzyzewski, Andrew Tokeley, Chris O'Donoghue, Darren Wood, Nigel Parker

This is a panel discussion so come along and contribute to the conversation. What will web applications of the future look like? Is the browser the right medium to deliver web applications? What about mobile devices and ubiquitous computing? What are the roles of HTML 5/Silverlight? Can/should they live together in harmony? Are web standards holding back innovation? What about Privacy, Security and Content Protection? How is the business of the Web changing?

author: Tokes | posted @ Friday, August 06, 2010 4:34 PM | Feedback (0)

Excel 2010 – Copying Cells to Clipboard As Image


imageI’ve been using Excel for (literally) decades and I never knew about this one – kind of understandable since it’s not where you’d immediately think to look.

The scenario I’ve found myself in recently is to be able to copy portions of an Excel worksheet into our intranet as an image – typically where the range is too big to screen capture.

Some applications allow you to Paste Special the copied cells as an image but with our intranet and other applications that’s not always possible.

So to Copy you selection into the clipboard as an image go to the Paste menu (of course!), select As Picture –> Copy as Picture...

author: Tokes | posted @ Monday, August 02, 2010 8:24 AM | Feedback (1)

Down Memory Lane with the 7 Link Challenge


Unsurprisingly, Darren Rowse sure knows how to attract attention to his blog with a call for bloggers around the world to join the 7 link challenge. The idea is you answer 7 questions that highlight some of your blog’s highlights.

So here goes…

  • My first post – somewhat ironically, I found out about Darren’s challenge but reading Simone’s list – Simone put me on to using SubText as my blog engine and is mentioned in my, somewhat lame, first ever post.
  • The post I enjoyed writing the most – was in fact one that contained very few words and involved creating a single diagram that I thought captured the core concepts behind the often bewildering WCF – WCF Simplified to a Single Diagram. I was a software architect for long enough that the desire to draw boxes with lines between them was too strong.
  • The post which had a great discussion – would have to be a fantastic post about How To Impress at Your Next Interview where one of my top peeves was a CV with spelling mistakes. Unfortunately the post itself was riddled with typos to the vast amusement of those reading it! I think I’ve updated most of the mistakes but the comments tell the story nicely.
  • A post on someone else’s blog that you wish you had written – I recently read a great response to someone trying to compare Javascript with Silverlight and making a real hash of it. The response was measured and, unlike the other post, accurate – I like reading people who can keep a calm head and not get lost in emotional hype.
  • A post with a title I’m proud of – not sure I actually take any pride in my post titles but I quite like the directness of UISpy – Download it Here! – especially since there was a decidedly non-direct path to finding it. Lots of direct search hits when someone is looking to download it now.
  • A post you wish more people had read -  was hoping that my rumour starting would generate some sort of confirmation from someone… .NET Rocks Duo Coming to New Zealand?
  • My most helpful/visited post – only recently overtaken by The Difference Between “Add Web Reference” and “Add Service Reference” the post that has been read and commented on most would have to be Do You Really Want to be a Development Team Leader

Am convinced I enjoyed that more than you, but hey, it’s my blog ;-)

PS – go Sky , Chris and Kirk

author: Tokes | posted @ Monday, July 26, 2010 2:21 PM | Feedback (0)

MVVM and Confirmation Dialogs


Providing a confirmation dialog is one of those common requirements that aren’t typically covered when you start reading about the MVVM pattern. Here’s an approach that allows you to still make use of Commands, keep your View Model testable, avoid having to put code behind your View and create a reusable approach for all types of dialogs

imageimage

Even if you’ve defined an ICommand property in your View Model it may still be tempting to simply handle the button’s click event, get a reference to the View Model and wrap calling it depending on the result of a simple MessageBox.

private void deleteButton_Click(object sender, RoutedEventArgs e)
{
    MainViewModel viewModel = DataContext as MainViewModel;
 
    MessageBoxResult result = MessageBox.Show("Are you sure...", "Delete Confirmation", MessageBoxButton.OKCancel);
    if (result == MessageBoxResult.OK)
    {
        viewModel.DeleteCommand.Execute(null);
    }
}

Regardless of how you feel about putting code in your View’s code-behind, this approach, has a few drawbacks.

  • You lose the benefit of binding the Button’s Command and CommandParameter properties – for example, your button won’t automatically disable based on the ICommand.CanExecute property and you have to call Execute explicitly.
  • Your View Model can’t force the user to confirm an action – this is business logic that it should ideally be in control of.
  • You can’t easily test this behaviour.

So here’s another approach – a bit more code but once you’ve set it up it’s about the same amount of effort.

First let’s create an Interface that describes how our View Model might work with a dialog.

public interface IDialogService
{
    int Width { get; set; }
    int Height { get; set; }
    void Show(string title, string message, Action<DialogResult> onClosedCallback);
}

The Show method includes a callback method that has a single parameter, DialogResult, (a simple class I created that contains a boolean Result property) for the result of the dialog confirmation. The callback will be called by any class that implements the IDialogService.

Now, a concrete implementation of this interface could look like this (note I haven’t used a MessageBox dialog this time and have referenced a custom ChildWindow),

public class DialogService: IDialogService
{
    public int Width { get; set; }
    public int Height { get; set; }
 
    public void Show(string title, string message, Action<DialogResult> onClosedCallback)
    {
        // Instantiate a custom ChildWindow that contains a message body that we 
        // can set in the constructor
        ConfirmationDialog dialog = new ConfirmationDialog(message);
 
        // Set the title of the dialog
        dialog.Title = title;
        
        // When the dialog is closed we call the callback (if it exists) with the 
        // result.
        dialog.Closed += (s, e) => 
        {
            if (onClosedCallback != null)
            {
                DialogResult result = new DialogResult();
                result.Result = dialog.DialogResult;
                onClosedCallback(result);
            }
        };
 
        dialog.Width = Width;
        dialog.Height = Height;
        dialog.Show();                
 
    }
}

Adding the IDialogService to our View Model’s constructor allows us to inject a DialogService without the View Model needing to know the details or interact with any user interface.

public class MainViewModel : ViewModelBase
    {
 
    IDialogService DialogService { get; set; }
    public MainViewModel(IDialogService dialogService)
    {
        DialogService = dialogService;
        dialogService.Width = 300;
        dialogService.Height = 200;
    }
    ...
}

It’s then pretty easy to create a Command that requires a confirmation dialog.

DelegateCommand _deleteCommand = null;
public DelegateCommand DeleteCommand
{
    get
    {
        if (_deleteCommand == null)
        {
            _deleteCommand = new DelegateCommand()
            {
                ExecuteAction = (p) =>
                {
                    DialogService.Show(
                        "Delete Confirmation",
                        "Are you sure you want to delete this? There's no turning back",
                        (DialogResult result) =>
                        {
                            if (result.Result.Value)
                            {
                                // You can delete now
                            }
                            else
                            {
                                // Don't delete - abort, abort
                            }
                        }
                    );
                }
            };
        }
        return _deleteCommand;
    }
}

You can now reuse this approach throughout your application.

Easy.

Download Example Files

author: Tokes | posted @ Sunday, July 25, 2010 9:23 PM | Feedback (0)

Apple vs Microsoft


Couldn’t agree more with Jeff Blankenburg’s post on the unnecessary hostility towards Microsoft’s Window’s Phone 7 device and the smug arrogance of people towards something that could be really cool – it’s just soooo childish ;-)

image

image

author: Tokes | posted @ Thursday, July 15, 2010 2:42 PM | Feedback (3)

MVVM Uncovered


mvvmcheerleadersGood to see everyone at last night's Silverlight User Group – sorry I had to run out so quickly afterwards and couldn’t stay very long to chat, had an appointment with a Dutchman and didn’t want to disappoint someone from the land of the next World Cup champions – Hup Holland!

Anyway, here are the slides/demos if you want a closer look at what we covered. Demos include,

  • Designer Support
  • Commanding
  • DelegateCommand
  • Validation Approaches
  • Updating UI From Another Thread

Demo/Slides

author: Tokes | posted @ Friday, July 09, 2010 8:58 AM | Feedback (0)

MVVM Uncovered - Presentation


Hey, a heads up if you’re in Wellington NZ, next week then come along to the Silverlight User Group (actually it’s now known as the Wellington Silverlight & Mobile Developers User Group, SLAMD) where I’ll be doing a presentation on MVVM.

Here’s the blurb.

When it comes to presentation design patterns MVVM is perhaps one of the most simple and, certainly for Silverlight (and WPF), the most compelling of the bunch. In fact, Silverlight, WPF, Blend and Visual Studio 2010 all contain features geared towards making MVVM the natural choice. This session will give you an overview of what MVVM is all about, covering topics such as DataBinding, Commanding, Validation, Testing and more...

Here’s the time and place,

Xero,

Level 1, Old Bank Arcade

98 Customhouse Quay

from 6pm on the 8th July.

RSVP to skysigal@xact-solutions.com

author: Tokes | posted @ Friday, July 02, 2010 2:32 PM | Feedback (0)

ASP.Wizard Control Without Tables


I wrote this post almost 2 years ago showing how to use CSS Adapters to control the rendering of server controls that output non compliant HTML (table based ones in particular). I’ve still been getting lots of hits and questions on the post but if you’re using ASP.NET 4.0 there is a way easier approach.

Read about LayoutTemplates here,

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.wizard.layouttemplate.aspx

Cheers

author: Tokes | posted @ Monday, June 28, 2010 8:56 AM | Feedback (0)