Looking Forward: Single Page Apps, Client-Side Databinding, Entity Change Tracking, and Windows 8

I had the opportunity to attend the MVP Summit and some other events that were also running up in Redmond, WA for Windows 8 and ASP.NET this past week and if there’s one thing I learned it’s that Microsoft’s developers definitely aren’t sitting around idly twiddling their thumbs. A slew of new technologies are on their way which adds to the fun if you’re someone who enjoys learning, being challenged, and having access to technologies that can help you be more productive. For me personally, that’s the fun of being in the development world. Change is part of the game and embracing it is key to being successful as a developer - at least in my opinion. While it’s true that not every new technology deserves attention (and I’d agree that some technologies seem to move too fast), there were several I saw that have some great potential. The good news is that they’re available to start using or experimenting with now if you’re interested.

So what should you learn and how do you get started? Everything that follows is completely subjective of course, but if you’re a Web developer then knowing JavaScript and jQuery definitely won’t hurt you a bit. That includes developing for Windows 8. Developers skilled in JavaScript/jQuery will definitely be ahead of the game with the new technologies that are coming out. Sometimes it feels like I’m 1 out of 2 total developers on the planet that seem to actually like JavaScript (always have for some reason going back to the mid 90s), but I like the overall direction things are moving especially when I consider what it means for clients using my applications.

Web Development Technologies

For Web developers, there are several technologies that I think are worthy of taking a closer look:

  • ASP.NET MVC Single Page Applications (client-centric application relying on JavaScript, uses Knockout and Upshot, can work on the desktop browser or on mobile devices)
  • ASP.NET Web API (new server-side API for serving different data formats to a variety of applications)
  • Knockout (client-side databinding, templating, and more)
  • Upshot (client-side data sources, tracking client-side insert/update/delete changes, accessing server APIs using Ajax)

ASP.NET MVC Single Page Applications provide a flexible, client-centric way to build applications. They rely on ASP.NET MVC which renders the initial HTML, JavaScript libraries such as Knockout and Upshot for data binding and data access, and the ASP.NET Web API for serving and modifying data on the server. Many of the technologies could be used on their own as well in standard HTML pages. Single Page Applications add support for additional functionality that most Web applications don’t normally have including history support, deep linking, and offline applications. Check out Steve Sanderson’s presentation at TechDays for a nice overview of what can be done with Single Page Applications. I’m starting work on a new course for Pluralsight that will cover the ins-and-outs of building ASP.NET MVC Single Page Applications and using technologies like the Web API and Upshot and am really excited about the functionality Microsoft is providing in this space.

If you already know JavaScript, jQuery, and related technologies then I’d highly recommend jumping into technologies like Knockout since it’s well established, adds a tremendous amount of productivity to your arsenal (two-way databinding in HTML pages anyone?), has great samples, and a large following on the Web. My good friend John Papa has an awesome course on everything you need to know to get started with KnockoutJS on Pluralsight that you can find here. I highly recommend it if you’d like to learn more about using Knockout in your Web applications today.

image

Here’s a description of the course:

Do you write a lot of HTML, JavaScript, and jQuery to push and pull data? Does your JavaScript seem to lack the structure and patterns of your non script code? In this course you will learn popular techniques to use data binding to bind your data to your target controls in HTML writing less code, but gaining more power. See how to consume json data, use json objects in JavaScript, and use declarative binding all by using the KnockoutJS JavaScript library. Learn how the XAML data binding paradigm has been brought to the web world with observable objects, change notifications, subscriptions, and 2 way bindings. Explore modern JavaScript patterns and practices that follow the SOLID principles, reduce errors in your code, and make code easier to maintain. After taking this course you will have a solid foundation for building robust web apps using common JavaScript patterns, MVVM, and KnockoutJS.

Desktop (or Web) Development Technologies

Microsoft just released the Consumer Preview of Windows 8 and I’ll admit I’m really excited about it – especially the opportunity that the App Store presents. I have it running on both my laptop and desktop machines at this point. Check out Scott Hanselman’s post on setting up a bootable VHD if you’re interested in getting it going without messing up your existing OS. See my previous post titled Why I’m Excited about Windows 8 for additional details on why I’m looking forward to the new OS.

From a development standpoint, you have two options for building Windows 8 Metro style Apps that will be deployed in the upcoming Windows App Store:

  1. Build XAML applications with C#, C++, VB, etc.
  2. Build HTML5/JavaScript applications

If you’re already building WPF or Silverlight applications then the move to XAML-based Metro Apps will be relatively painless. Sure, you’ll have to learn the new WinRT namespaces, classes, and overall API, but things map up pretty nicely with the stuff you’re already used to. I’m a big fan of XAML based on my experience with Silverlight and WPF so it’s exciting to see that the skills I already have in that area can be leveraged to build Metro Apps.

If you’re building Web applications you can use your existing skills to build Metro Apps as well. That includes using HTML5, JavaScript, jQuery, and other popular libraries out there. By default, applications rely on WinJS scripts for rendering UI, performing animations, using platform controls, performing data binding, etc. but you can certainly use other libraries as well to perform a variety of tasks. Although the apps are written using HTML5 and JavaScript, they’re packaged up and can be placed in the Windows 8 App Store for consumers to download.

Developers building Windows Forms, WPF, or Silverlight apps can also target the desktop mode of Windows 8 (non-Metro Apps) and existing applications are supposed to port over nicely to Windows 8 (I haven’t had a chance to validate this claim yet but everything I’ve tried over the past few days has worked perfectly). That means that various types of desktop applications can still be used just as they are on Windows XP, Vista, or Windows 7.

John Papa and I put together a course on getting started building Windows 8 Metro Apps if you’re interested in jumping into that arena that can also be found on Pluralsight.

 

image

Here’s a description of the course:

Windows 8 Metro style apps provide a new opportunity for developers to interact with users and provide a more immersive experience on the desktop or on touch devices. This course covers fundamentals you need to know to get started building Metro apps quickly using Visual Studio 11. Topics covered include an overview of Windows 8 and Metro app features as well as key features that you need to know to build HTML/JavaScript or XAML/C# Metro apps.

 

Summary

There’s a lot of new technology coming our way in the near future. Some of it may change how we write existing applications and some of it may go the way of the Dodo and be extinct in a few years. It’s always hard to know what technologies to tackle but I’m betting on many of the technologies I discussed here sticking around for quite awhile. While it’s not all roses, I definitely feel excited about the future of Web and Desktop development and like the overall direction that Microsoft is going.

Published Saturday, March 3, 2012 5:41 PM by dwahlin

Comments

No Comments