Book Review Smart Access “” Peter Vogel

In this article, Peter Vogel looks at a book by two of the gurus of relational design, where they discuss the essence of the theory, its relationship with object- The Third Manifesto oriented , and its possible future. Foundation for Future Database Systems: The Third Manifesto By C. J. Date and ’VE said on many occasions that to build great Addison-Wesley, ISBN 0201709287 applications, you have to build great databases—and Ithat building great databases means understanding the relational database theory. Currently, we’re fortunate relational database theory isn’t simply one way to store enough to have two excellent books on relational database and manage data. The book makes it clear that the design available: Database Design for Mere Mortals by authors feel that the relational theory is the only sound Michael Hernandez (Addison-Wesley, ISBN 0201694719) basis for understanding the structure of data and for and Designing Relational Database Systems by Rebecca managing data in applications. Riordan (Microsoft Press, ISBN 073560634X). Equally The authors do believe, however, that it’s necessary to important to creating great applications is a command of clear up some misunderstandings among both relational SQL. There’s no single book that stands out here, but a database designers and object-oriented developers. They combination of SQL Queries for Mere Mortals by Michael feel that two issues (or, as they call them in the book, Hernandez, John Viescas, and Joe Celko (Addison-Wesley, “blunders”) are central to confusion about the nature of ISBN 0201433362) and Joe Celko’s own SQL for Smarties objects and relational database theory. (especially the second edition, from Morgan Kaufman The primary blunder is a confusion between “values” Publishers, ISBN 1558605762) probably should be on and “variables.” The authors feel that a relation (or a table every developer’s shelf. In my mind, SQL and relational design, to be more concrete) is a value. A value, after all, is database design go together: If you get the database like the number 3: unchanging and independent of any design right, you can use SQL to solve your problems; if location in time or space. So, too, a relation is unchanging you can use SQL, you can eliminate code and get the and independent of any location in time or space. A highest possible level of performance in your application. relation expressed in a table design with columns like Foundation for Future Database Systems: The Third CustomerNumber, CustomerName, CreditHistory, and Manifesto goes beyond these books to discuss the so forth doesn’t change over the life of the table. foundations of relational database theory and sketch A table’s contents, however, do change over time as out one possible future for relational database design. records are added, deleted, and modified. The contents of The authors’ particular goal is to describe how the a relation (or table) are a set of facts (or rows), each of current interest in object-oriented development relates which is considered to be true. So the Customer table that to relational databases. The authors of the book are two I described previously will contain different customer of the most prominent gurus in the field and have written relations (rows) at different times. A table, therefore, is a a number of books together. If you’re interested in the variable that holds different values at different times. SQL standard, for instance, their A Guide to the SQL A variable that holds different string values is Standard is an introduction to the SQL language that’s called a “string variable.” In the terminology of The independent of any particular vendor’s implementation. Third Manifesto, a table is a relation variable (or “relvar”): a variable containing different relation values at Blunders different times. The Third Manifesto takes its name from the authors’ The distinction between values and variables is intent. The book is designed to follow up on two previous important because the authors go on to discuss a second books that advocated significant changes to the relational misunderstanding, this time in the field of object-oriented theory to support future application development. development. They tackle the thorny question of “What is Date and Darwen’s contention is simple: No such an object?” They begin by assuming that an object must modifications are necessary. The authors believe that the be one of a value, a variable, or a data type. Given their

16 Smart Access June 2001 http://www.smartaccessnewsletter.com definition of value and variable, their conclusion is runs about 30 pages and is organized around a set of that the only definition of an object that makes sense is recommendations. Fortunately for lay readers like that an object is a data type. The authors feel that you myself, a large part of this book is a commentary on the should speak of a “Customer object” in the same way manifesto, explaining, exploring, and explicating it for that you speak of a “string variable.” A string variable people who find the manifesto’s language a struggle to holds different string values over time. In the same read and appreciate (for instance, me). way, a Customer object holds different Customer values The manifesto proper and its commentary form only over time. part of the book, though. Recognizing that accessing data is as important as structuring it, Date and Darwen go Objects and variables on to discuss a true relational data access language— This definition of an object might strike you as odd (it which isn’t SQL. certainly struck me as odd). An object, after all, has While Darwen sits on the SQL standards committee, methods, properties, and events—something that I the authors’ attitude toward SQL is far from their don’t think of data types as having. However, the authors unreserved support for relational database theory. Date make the case that any data type has a set of operators has been especially critical of the language, as he feels designed for it and that these operators correspond to that it perverts the nature of the relational theory. In The the methods of an object. For instance, in VBA, there’s a Third Manifesto, the authors distinguish between “SQL set of operators that I can use with numeric variables databases” and true relational databases. They even (for instance, the math operators, +, -, /, *). In VBA, I’m advance a new language as the basis for a true relational also constrained from using operators that aren’t defined access tool. They make it very clear that their language for numeric variables (for example, the concatenation is designed as a model for an actual implementation, operator &, which is defined for strings). In the same way but they also make it clear that without a true relation that a numeric variable has operators designed to be used language we’re all hampered by having to use SQL. This with it, an object has a set of operators (methods) that are new language supports using user-defined operators to designed to be used with it. allow objects to be stored in tables. If you think of a variable as a simple data item with Other sections of the book discuss a way of handling a set of routines designed to work with its data, then it’s inheritance by allowing for operators to be inherited, not hard to think of an object as a complex data item review some of the literature on object-oriented databases, with a set of routines designed to work with its data. and discuss other, related topics. With this definition in hand, the authors go on to say I’ll be the first to admit that I lack the theoretical that the relational theory can fully support objects as understanding of database theory to appreciate all of this simply another data type for a column in a relation. All book (many paragraphs flew straight over my head). that’s necessary is to allow developers a way to specify I suspect that I’ve sufficiently simplified the authors’ the operators for any data type that they want to use. discussion to distort it, at least in part. However, if you’re The corollary to this view is that developers shouldn’t interested in relational database theory, you owe it to think of relational databases as a place where only simple yourself to take the time to tackle this book. It will stretch database types can be stored. I’ve always assumed that I your mind, expand your understanding, and help make can only use in a database those data types defined by the you a more sophisticated database designer. And, if Date system. Date and Darwen suggest that there’s no reason and Darwen’s work does turn out to be the basis of a why I shouldn’t be able to define and use my own data renaissance in database implementations, you’ll be ready types (objects). All that’s necessary is that I be able to to take advantage of it. ▲ define the operators for those data types rather than have to settle for system-defined operators. To that end, they Peter Vogel (MBA, MCSD) is the editor of Smart Access and a principal in propose a language for describing operators for data PH&V Information Services. PH&V specializes in system design and types. One feature of that language is the privileged development for COM/COM+ based systems. Peter has designed, built, operator(s) that extract and update the value of the data and installed intranet and component-based systems for Bayer AG, Exxon, Christie Digital, and the Canadian Imperial Bank of Commerce. type, which they refer to generically as _THE operator(s). He’s also the editor of Pinnacle’s XML Developer newsletter and wrote The Visual Basic Object and Component Handbook (Prentice Hall), currently Contents being revised for .NET. Peter teaches for Learning Tree International and The structure of the book is interesting. The original wrote its Web application development and technical writing courses, manifesto has been circulating for several years as the along with being technical editor of its COM+ course. His articles have authors sought comment from the relational theory appeared in every major magazine devoted to VB-based development community and developed their ideas. This book and in the Microsoft Developer Network libraries. Peter also presents at contains the manifesto—a dense, theoretical work—that conferences in North America and Europe. [email protected].

http://www.smartaccessnewsletter.com Smart Access June 2001 17