Toolbox
Networking, Rich UIs, and More
Scott Mitchell

Contents
Perform Network-Level Operations
End users today expect a level of interconnectivity between applications that was unheard of a mere five years ago. Many applications periodically determine if a new version is available and, if so, offer to download and install it. Financial applications will connect to the Internet for the latest stock quotes. Games seamlessly integrate with online services to keep track of a user’s high scores and how she ranks among her peers. These operations can be performed using a variety of technologies, from low-level TCP or UDP messages to HTTP or FTP requests; they may involve custom message-level protocols or industry standard ones.
Adding connectivity features can be daunting for developers who are mostly experienced in traditional application development paradigms. Network operations are built atop very precise, low-level specifications that leave no room for error. There are many different ways a network operation can fail, which introduces many edge cases that need to be handled. For these reasons, it’s often foolhardy for developers to tackle network-level operations on their own. They should instead rely on a framework or third-party component to provide high-level abstractions for the low-level networking needs.
The Microsoft® .NET Framework provides some classes for network-level operations in its System.Net namespace. There are classes designed for making HTTP and FTP requests and for working with socket-level communications, among others. For a more in-depth set of networking functions, you’ll need to turn to a third-party component. One such component suite that offers the gamut of networking functionality is IP*Works! Version 6 by /n software. IP*Works! is a collection of components that supports a wide array of low-level protocols.
IP*Works! simplifies working with these technologies through high-level libraries. Want to work with a Web site’s RSS feed? There’s no need to programmatically parse the XML; just use the IP*Works! Rss class’s GetFeed(url) method. This populates the Rss class with the items defined in the RSS feed. The particular elements of each item can be accessed with properties like ItemTitle and ItemPubDate.
Part of the challenge of creating networked apps is the inherent asynchrony. When receiving network traffic, the responses come in as chunks at undeterminable times; when transmitting a file over the network, it’s not clear when the transmission will complete. To further complicate matters, during these asynchronous processes, things may go awry. That connection to the FTP server may reset, or the network connection may be lost. IP*Works! simplifies these operations by offering various classes with an expansive list of events for which event handlers can be created.Virtually all of the components use the standard .NET asynchronous programming model to make starting and managing asynchronous operations a familiar exercise.
Price: $499 per developer workstation (royalty-free distribution).
Slick UIs for ASP.NET Web Apps
For me, designing the user interface for an application can be quite challenging. I am a backend ASP.NET developer by profession and, honestly, lack any and all semblance of artistic acumen. (My user interfaces have been compared to the green and black monochrome mainframe applications from yesteryear.)
Creating a user interface isn’t hard—ASP.NET ships with a number of controls that provide the common UI patterns. It’s a breeze to add a textbox, dropdown list, checkbox, or an editable grid of data to a Web page, but it’s not as easy to make it look good.
True, Visual Studio® offers its Auto Format wizard (to which my end users are eternally grateful), but that’s just window dressing. While visual aesthetics are important in UI design, the overall usability of the interface is equally important. Here, too, there is little help from the built-in ASP.NET controls, which provide the building blocks of a user interface but leave the design work to the page developer.
For design-challenged developers like me, it’s often more cost effective to turn to a third-party control vendor than invest the time and energy in attempting to create a usable, eye-pleasing user interface. One such ASP.NET control vendor is telerik, which offers the r.a.d. controls suite. The r.a.d. controls suite is a collection of 18 custom controls that provide polished, professional-looking results for a variety of common user interface scenarios.
The r.a.d. editor provides a rich, WYSIWYG editing experience in a Web page, the r.a.d. grid displays and modifies data, and various navigation and categorization controls are offered.
The r.a.d. controls use themes to easily manage the aesthetics of the rendered output, and ship with a number of predefined themes, making it easy to create UIs that look like they came from a highly paid design shop. The r.a.d. controls offer more than just eye candy, though, as their rich feature set, coupled with AJAX support, allows for the creation of very fluid and straightforward user interfaces.
For example, the r.a.d. treeview allows a page visitor to change the name of a treeview node in place, supports dragging and dropping (both for the repositioning of nodes in a tree and moving nodes from one treeview to another), keyboard support, and context menus. Best of all, adding the rich user interface and wiring up the backend code is incredibly simple. Configuring a control to use the more involved user interface features is as simple as setting a few properties, and handling the complex user interface typically involves just creating an event handler.
If you are an artistically-challenged Web developer like yours truly, check out telerik’s r.a.d. controls suite. It will help you move from ho-hum user interfaces to ones that will bedazzle.
Price: $799 per developer license for the control suite.
Manage Your Font Library
Choosing the right font for the user interface in an application can be a trying task for developers who don’t have an art department backing them up. Most developers opt for whatever font Visual Studio recommends, in part because seeing how a particular chunk of text looks in different fonts is not readily accessible in Visual Studio or even in many word processor programs.
To help with the task of choosing a font, check out Advanced Font Viewer 2.6 by Styopkin Software. Advanced Font Viewer allows you to enter text and then display it in all of the fonts installed on the system. You can make the text bold, italic, underlined, or strike-through, and can adjust the font size. Additionally, you may select a single font and view samples of the inputted string with differing font sizes, explore the font’s character map, or inspect the font’s embedded information. You can also easily print fonts or view them in a Web browser to see how they appear in other media. Advanced Font Viewer also makes it easy to install new fonts and remove existing ones.
Picking the ideal font for your application can help improve the user experience and should not be a random choice or one based on Visual Studio presets. While Advanced Font Viewer is no substitute for a trained graphics designer, it can help those less experienced at font selection to quickly view their font choices and make a more informed decision.
Price: $39 per developer license.
The Bookshelf
In the past, a sure-fire way to determine the intended audience for a book was to peruse its figures. Beginner-level books were ones rife with screen shots showing step-by-step instructions; the advanced titles had a higher text-to-figure ratio and their figures were more likely to be fancy architectural-level diagrams. I say "in the past" because O’Reilly’s new series, "A Developer’s Notebook," turns that assumption on its head, providing step-by-step, visual tutorials from intermediate to advanced.
In ASP.NET 2.0: A Developer’s Notebook (O’Reilly, 2005), by Wei-Meng Lee, each chapter is broken down into a number of labs, with each lab focused on how to accomplish a particular task. You won’t find any high-level architectural discussions or best practices ruminations here—just a quick, step-by-step list and plenty of screen shots to help you follow along. Despite the straightforward step-by-step nature of these labs, they are clearly targeted for developers who know their stuff.
For example, the Chapter 4 labs focus on working with data in ASP.NET 2.0. You’ll find instructions on how to go from a blank ASP.NET page to one that lists database results filtered by the selected item in a dropdown list, with screen shots to walk you through the process.
The book contains over 50 labs spread out over eight chapters that cover Master Pages, Web Parts, data access, security, and performance, among other topics. My favorite chapters examine data access and security, respectively. In a combined 100 pages, Chapters 4 and 5 showcase ASP.NET 2.0 improvements in these two areas with labs that, in ASP.NET 1.x, would have required at least twice as many pages. While the whole book is a testament to ASP.NET 2.0 enhancements, these two chapters are likely to have ASP.NET 1.x developers most excited about the new possibilities.
A subtle, but very enjoyable touch found in the "A Developer’s Notebook" series is that the books really do look and feel like notebooks. The paper stock feels different than the standard computer trade book and has the same faded grid found in graph paper, and various notes appear in the margins in a font that looks like hand-written cursive. These nuances foster a sense of camaraderie with the author, as if he had let me borrow his personal notes. But, thankfully, these are notes I do not need to give back!
Price: $29.95.