Read an Excerpt
I’ve been designing and implementing database applications for longer than I’d care to talk about. For the last ten years or so, much of my work has involved helping organizations and other developers improve their existing designs. Even if this weren’t my line of work, like everyone else in the twenty-first century, I spend a lot of time using systems. Whenever I shop or do my banking, get a haircut or go to the doctor, I’m directly or indirectly dealing with a computer system somebody, somewhere, designed and implemented.
And most of these systems are just plain awful.
Now, I’m never entirely comfortable speaking for other people, but I’d be prepared to bet an entire year’s worth of chai that nobody has ever intentionally built a “user antagonistic” software system, so why are so many of the systems we use every day so far away from being “user friendly?”
Part of the answer is that we’re all so new at this. Think about it: We’ve been designing agricultural tools for thousands of years, but we’re still fiddling with the shape of a shovel. We’ve been designing computer programs for use by nonexperts for about twenty years. It’s not reasonable to expect us to have it quite figured out yet.
Another part of the answer is that none of us can be experts at everything. Given the complexity of today’s computer systems, is it reasonable to expect that any one person can be expert at business analysis, interviewing users, systems design, database design, interface design, programming in his or her chosen language (or, more likely these days, languages),testing, implementation, writing documentation, and training users? Of course it isn’t, and yet the realities of system development often require that we have to take on, if not all, at least several of these roles.
So, welcome to Seeing Data. I’m not going to promise to make you an expert on designing interfaces. I do promise to introduce you to the basic principles of designing user interfaces for database applications. I’ll show you the things you need to think about, the kinds of questions you need to ask yourself, and some of the answers in the form of working code snippets.
Most of the principles, and much of the sample code, work equally well with any kind of system, not just databases, but since that’s my background, and since most business systems do manipulate data in some way, those are the systems on which I’ve concentrated. Who Do I Think You Are?
To make the subject manageable, I’ve had to make some assumptions about what you already know. First, I assume that you have a basic understanding of database design. Specifically, I assume that you understand how databases are structured in terms of tables, columns, and rows, and the basics of database normalization. You should also understand the Structured Query Language (SQL) at least well enough to read the snippets, even if you always build your queries using an interactive tool.
I also assume that you have a basic understanding of the .NET Framework class hierarchy and the Visual Studio environment. I discuss the .NET Framework data-binding architecture in Chapter 6, “ADO .NET Data Binding,” but I assume that you have a basic understanding of the primary ADO.NET objects: the Connection, DataAdapter, DataSet, and DataTable.
The code examples in this book are in Visual Basic, since I believe it’s the easiest of the Visual Studio languages to read, but C# examples are available on the Web site for the book. I do not assume that you’re a professional programmer, only that you have some familiarity with the process. Nor do I assume that you have an intimate knowledge of either the Windows API or the internals of the .NET Framework CLR. What’s in This Book
In Section One of the book, we’ll look at each of the fundamental areas of interface design independently. We’ll begin with a general overview of interface principles, and then look at graphics, typography, color, and the use of images in the .NET Framework in some detail.
In the last chapter of the section, we’ll examine data binding with ADO.NET. This isn’t strictly part of interface design, but it is fundamental to the rest of the book. If you’re already an ADO.NET wizard, you can probably skip this chapter with impunity.
In the next two sections, we’ll look at how to build an interface from the perspective of the database schema. In Section Two, we’ll examine the canonical structures for entities, and how those entities can be represented in the user interface. In Section Three, we’ll examine each type of attribute and map them to .NET Framework controls.
In Section Four, we tackle the mechanics of how the system interacts with the user. We’ll examine methods for allowing the user to navigate through a DataSet and manipulate the data it stores. Then we’ll examine the methods you provide for allowing the user to control the application: menus, toolbars, and command buttons. After that we’ll discuss two closely related topics: the provision of user assistance and the maintenance of data integrity. In the last two chapters of the section, we’ll examine filtering and sorting data, and the provision of reports, both from the perspective of user interaction.
In the final section, we’ll look at the user interface from the point of view of the application itself. We’ll begin with an examination of the architecture of the application as a whole—how the constituent forms are structure, and the navigation method(s) presented to the user. We’ll follow this with a discussion of the methods your application can provide for user customization, and conclude with a brief discussion of the installation process, again from the point of view of how the application interacts with the user.
Finally, downloadable code is available at www.awprofessional.com/titles/0321205618. Here you will find all the Visual Basic .NET examples, along with C# equivalents. What Isn’t in This Book
As I’ve said, the principles we examine apply equally well to most types of applications running in most environments, but this book focuses on desktop database applications running under Microsoft Windows and built using the .NET Framework.
In particular, we won’t discuss thin-client applications or applications deployed on Windows CE. That said, all of the techniques, and many of the code snippets, can be directly transferred to applications running in these environments (provided, of course, that the applications are developed in Visual Studio).
In addition to the environment techniques, there is one subject area that we won’t be discussing: localization. There’s a very simple reason for this. I know very little about it, and my mother always said that a wise woman knows her limitations.