The Gooey GUI Decision
By Jonathan Goodyear
It s the annual TechEd issue of asp.netPRO magazine; hopefully I ve caught you before the end of the show, because we are at an interesting point in the Microsoft developer timeline and there are many choices to be made. One of the biggest of these choices is which framework to use to build the user interface (UI) for your next application.
For the purposes of this column, let s assume you re going to build an enterprise line of business (LOB) application. Some of the options you have are:
- Classic ASP.NET
- ASP.NET with AJAX
- Windows Forms
- Windows Forms with WPF user controls
- WPF application
- WPF with Windows Forms controls
- Silverlight 2.0 application (a full-blown application where EVERYTHING is Silverlight)
- ASP.NET with Silverlight user controls
Looking at the options above, the safest choices are to use Classic ASP.NET or Windows Forms. Both are battle tested, and both have a great deal of support from third-party control vendors. There is also a lot of supporting information available in books, magazines, and online. At the end of the day, though, there s only so far you can go with either of these safe routes, and, depending on the requirements of your application, you may run up against some significant technological barriers by sticking with old faithful.
Clearly, Microsoft would prefer for us to build all of our new applications using Windows Presentation Foundation (WPF) and its Web counterpart, Silverlight. Both have a fantastic upside in that you can create very compelling UIs and user experiences (UX). The problem is that there are several factors playing against this decision. Although WPF was released more than a year ago, third-party control support is still extremely limited and most of the offerings are still a bit quirky. Like all new software, it will take time for them to mature. Aside from that, the designer support for WPF and Silverlight (both in Visual Studio 2008 and Expression Blend) is still not very good, so you ll need to have a firm understanding of XAML (the XML-based syntax upon which both are based). This is an uphill climb, to say the least.
Lastly, Silverlight 2.0 (the version that enables complete Web application development and more than just simple media display) will likely not be formally released for close to another year. That is a significant risk factor if you intend to build a Web application on this framework. The rewards of using WPF and/or Silverlight will certainly be high, but at this juncture, I would expect a project of any non-trivial size or complexity to take as much as 50% longer to build. Despite the increased development time, it may be worth it if the application will be used for a very long time.
Several people have suggested taking a hybrid approach to building the UI for your next application. For desktop applications, that means hosting WPF controls inside a Windows Forms application shell or hosting Windows Forms controls inside a WPF application shell. For a Web application, this would mean embedding Silverlight user controls inside an ASP.NET application shell. I suggest that taking this approach is good if you are interested in building WPF skills and you carry the hope that you could use parts of the current system that you are building in an eventual migration to a full WPF solution. Whenever you re stitching multiple technologies together, though, there will be some discontinuity and a bit of extra hacking (and patience) necessary to get everything to work. If you ve ever built some .NET components for a VB6 application or integrated some COM components into a .NET application, you certainly know what I mean. It s not a definite no go option, but I would carefully consider the pure options first before going down the hybrid road.
Each of the options above has its benefits and its drawbacks. We re in a bit of a pickle because the new technologies (despite some compelling but often a bit misleading demos) aren t quite as mature as Microsoft would have you believe. However, if you re building an application with a lifespan of five to 10 years or more, do you really want to start off using a technology that s on its way out now?
I haven t even brought Microsoft Office and SharePoint into the conversation. They are both options, as well, but they tend to have their own unique niches in the application development space. One last note about ASP.NET. If you decide to build your solution using one of the approaches that includes ASP.NET (e.g., by itself and/or with AJAX and/or with Silverlight), which is highly likely if you are reading asp.netPRO, you also need to consider whether you ll use WebForms or Microsoft s new Model View Controller (MVC) Framework (see Shift --> MVC). You can even combine them if the need arises.
There are just so many choices that you need to consider before you even get started building your next application. The framework that you decide to use for your application s UI can have a significant impact on the amount of time it takes to complete the project, as well as its chances for success. Definitely take your time and do your research before making this all-important decision, and don t be afraid to ask around to find out how others are doing things and how much success they re having doing it. TechEd is the right place to do just that.
Jonathan Goodyear is president of ASPSOFT (http:// www.aspsoft.com), an Internet consulting firm based in Orlando, FL. Jonathan is Microsoft Regional Director for Florida, an ASP.NET MVP, a Microsoft Certified Solution Developer (MCSD), and co-author of ASP.NET 2.0 MVP Hacks (Wrox). Jonathan also is a contributing editor for asp.netPRO. E-mail him at mailto: [email protected] or through his angryCoder eZine at http:// www.angryCoder.com.