46 Pages

ordb

Course: CS 662, Fall 2008
School: UVA
Rating:
 
 
 
 
 

Word Count: 13904

Document Preview

to Chapter 1 Introduction Object-Relational Database Development Overview This book describes the Object-Relational Database Management Systems (ORDBMS) technology implemented in the INFORMIX Dynamic Server (IDS) product, and explains how to use it. This first chapter introduces the basic ideas behind object-relational, or extensible, DBMSs. It is intended as a road map to guide readers in their own exploration...

Register Now

Unformatted Document Excerpt

Coursehero >> Virginia >> UVA >> CS 662

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
to Chapter 1 Introduction Object-Relational Database Development Overview This book describes the Object-Relational Database Management Systems (ORDBMS) technology implemented in the INFORMIX Dynamic Server (IDS) product, and explains how to use it. This first chapter introduces the basic ideas behind object-relational, or extensible, DBMSs. It is intended as a road map to guide readers in their own exploration of the material. We begin with a little historical background explaining the motivation behind an ORDBMS product such as IDS. At this early stage of the book, it is enough to say that ORDBMS technology significantly changes the way you should think about using a database. In contrast with the more byte-oriented Relational DataBase Management System (RDBMS) technology, an object-relational database organizes the data and behavior of business objects within an abstract data model. Object-Relational query statements deal with objects personal name, part, code, polygon and video, instead of INTEGER, VARCHAR or DECIMAL data values. 1 The chapter continues with a high-level description of the features and functionality of IDS. We introduce the Object-Relational (OR) data model, type and function extensibility, storage manager extensibility, and active database features. Later chapters of the book address each topic in more detail. Moving along, we take a little time to examine how an ORDBMS is implemented internally. This digression is important because it provides a framework for understanding the best way to use the technology. An ORDBMS is a lot like an operating system. It manages resources such as memory, I/O, thread scheduling, and interprocess communications. Developers can acquire these resources from the ORDBMS for their own programs, which run under the control of the ORDBMS (instead of the operating system). Where the ORDBMS differs from a traditional operating system is in how it reorganizes its programs. Instead of running business logic, an ORDBMS executes it as part of a declarative query expression We conclude this chapter with a brief description of the Movies-R-Us website--a sample database application--which provides many of this book's examples. Evolution of Database Management Systems The history of DataBase Management Systems (DBMS) is an evolutionary history. Each successive wave of innovation can be seen as a response either to some limiting aspect of the technology preceding it or to demands from new application domains. In economic terms, successful information technology lowers the costs incurred when implementing a solution to a particular problem. Lowering development costs increases the range of information management problems that can be dealt with in a cost-effective way, leading to new waves of systems development. Data Processing Data Management User-Interface Figure 11. Functional Decomposition of an Information System 2 Chapter One Introduction to Object-Relational Database Development As an example of changing development costs, consider that early mainframe information systems became popular because they could make numerical calculations with unprecedented speed and accuracy (by the standards of the time). This had a major impact on how businesses managed financial assets and how engineering projects were undertaken. It took another evolutionary step--the invention of higher level languages such as COBOL--to get to the point that the economic return from a production management system justified the development cost. It took still another innovation--the adoption of relational DBMSs-- before customer management and human resource systems could be automated. Today it is difficult to imagine how you could use COBOL and ISAM to build the number and variety of e-commerce Web sites that have sprung up over the last three years. And looking ahead, as we move into an era of ubiquitous, mobile computers and the growing importance of digital media, it is difficult to see how RDBMS technology can cope. Early Information Systems Pioneering information systems of the late 1960s and early 1970s were constrained by the capacity of the computers on which they ran. Hardware was relatively expensive, and by today's standards, quite limited. Consequently, considerable human effort was devoted to optimizing programming code. Diverting effort from functionality to efficiency constrained the ambition of early developers, but the diversion of effort was necessary because it was the only way to develop an information system that ran with adequate performance. Information systems of this era were implemented as monolithic programs combining user-interface, data processing logic, and data management operations into a single executable on a single machine. Such programs intermingled low-level descriptions of data structure details-- how records were laid out on disk, how records were interrelated--with user-interface management code. User-interface management code would dictate, for example, where an element from a disk record went on the screen. Maintaining and evolving these systems, even to perform tasks as simple as adding new data fields and indexes, required programmers to make changes involving most aspects of the system. Experience has shown that development is the least expensive stage of an information system's life cycle. Programming and debugging take time and money, but by far the largest percentage of the total cost of an information system is incurred after it goes into production. As the business environment changes, there is considerable pressure to Evolution of Database Management Systems 3 change systems with it. Changing a pre-relational information system, either to fix bugs or to make enhancements, is extremely difficult. Yet, there is always considerable pressure to do so. In addition, hardware constantly gets faster and cheaper. A second problem with these early systems is that as their complexity increased, it became increasingly important to detect errors in the design stage. The most pervasive design problem was redundancy, which occurs when storage structure designs record an item of information twice. Relational DataBase Management Systems In 1970 an IBM researcher named Ted Codd wrote a paper that described a new approach to the management of "large shared data banks." In his paper Codd identifies two objectives for managing shared data. The first of these is data independence, which dictates that applications using a database be maintained independent of the physical details by which the database organizes itself. Second, he describes a series of rules to ensure that the shared data is consistent by eliminating any redundancy in the database's design. Codd's paper deliberately ignores any consideration of how his model might be implemented. He was attempting to define an abstraction of the problem of information management: a general framework for thinking about and working with information. The Relational Model Codd described had three parts: a data model, a means of expressing operations in a high-level language, and a set of design principles that ensured the elimination of certain kinds of redundant data problems. Codd's relational model views data as being stored in tables containing a variable number of rows (or records), each of which has a fixed number of columns. Something like a telephone directory or a registry of births, deaths, and marriages, is a good analogy for a table. Each entry contains different information but is identical in its form to all other entries of the same kind. The relational model also describes a number of logical operations that could be performed over the data. These operations included a means of getting a subset of rows (all names in the telephone directory with the surname "Brown"), a subset of columns (just the name and number), or data from a combination of tables (a person who is married to a person with a particular phone number). By borrowing mathematical techniques from predicate logic, Codd was able to derive a series of design principles that could be used to guarantee that the database's structure was free of the kinds of redundancy so 4 Chapter One Introduction to Object-Relational Database Development problematic in other systems. Greatly expanded by later writers, these ideas formed the basis of the theory of normal forms. Properly applied, the system of normal form rules can ensure that the database's logical design is free of redundancy and, therefore, any possibility of anomalies in the data. Relational Database Implementation During the early 1970s, several parallel research projects set out to implement a working RDBMS. This turned out to be very hard. It wasn't until the late 1980s that RDBMS products worked acceptably in the kinds of high-end, online transactions processing applications served so well by earlier technologies. Despite the technical shortcomings RDBMS technology exploded in popularity because even the earliest products made it cheaper, quicker, and easier to build information systems. For an increasing number of applications, economics favored spending more on hardware and less on people. RDBMS technology made it possible to develop information systems that, while desirable from a business management point of view, had been deemed too expensive. To emphasize the difference between the relational and pre-relational approaches, a four hundred line C program can be replaced by the SQL-92 expression in Listing 11. CREATE TABLE Employees ( Name VARCHAR(128), DOB DATE, Salary DECIMAL(10,2), Address VARCHAR(128) ); Listing 11. Simple SQL-92 Translation of the Previous C Code The code in Listing 11 implements considerably more functionality than a C program because RDBMSs provide transactional guarantees for data changes. They automatically employ locking, logging, and backup and recovery facilities to guarantee the integrity of the data they store. Also, RDBMSs provide elaborate security features. Different tables in the same database can be made accessible only by different groups of users. All of this built-in functionality means that developers focus more of their effort on their system's functionality and less on complex technical details. Evolution of Database Management Systems 5 With today's RDBMSs, the simple Employees table we introduced in Listing 11 is more usually defined as shown in Listing 12. CREATE TABLE Employees ( FirstName VARCHAR(32) NOT NULL, Surname VARCHAR(64) NOT NULL, DOB DATE NOT NULL, Salary DECIMAL(10,2) NOT NULL CHECK ( Salary > 0.0 ), Address_1 VARCHAR(64) NOT NULL, Address_2 VARCHAR(64) NOT NULL, City VARCHAR(48) NOT NULL, State CHAR(2) NOT NULL, ZipCode INTEGER NOT NULL, PRIMARY KEY ( Surname, FirstName, DOB ) ); Listing 12. Regular SQL-92 Version of the Employees Table Today the global market for RDBMS software, services, and applications that use relational databases exceeds $50 billion annually. SQL-92 databases remain a simple, familiar, and flexible model for managing most kinds of business data. The engineering inside modern relational database systems enables them to achieve acceptable performance levels in terms of both data throughput and query response times over very large amounts of information. Problems with RDBMSs Starting in the late 1980s, several deficiencies in relational DBMS products began receiving a lot of attention. The first deficiency is that the dominant relational language, SQL-92, is limiting in several important respects. For instance, SQL-92 supports a restricted set of built-in types that accommodate only numbers and strings, but many database applications began to include deal with complex objects such as geographic points, text, and digital signal data. A related problem concerns how this data is used. Conceptually simple questions involving complex data structures turn into lengthy SQL-92 queries. The second deficiency is that the relational model suffers from certain structural shortcomings. Relational tables are flat and do not provide good support for nested structures, such as sets and arrays. Also, certain kinds of relationships, such as subtyping, between database 6 Chapter One Introduction to Object-Relational Database Development objects are hard to represent in the model. (Subtyping occurs when we say that one kind of thing, such as a SalesPerson, is a subtype of another kid of thing, such as an Employee.) SQL-92 supports only independent tables of rows and columns. The third deficiency is that RDBMS technology did not take advantage of object-oriented (OO) approaches to software engineering which have gained widespread acceptance in industry. OO techniques reduce development costs and improve information system quality by adopting an object-centric view of software development. This involves integrating the data and behavior of a real-world entity into a single software module or component. A complex data structure or algorithmically sophisticated operation can be hidden behind a set of interfaces. This allows another programmer to make use of the complex functionality without having to understand how it is implemented. The relational model did a pretty good job handling most information management problems. But for an emerging class of problems RDBMS technology could be improved upon. Object-Oriented DBMS Object-Oriented Database Management Systems (OODBMS) are an extension of OO programming language techniques into the field of persistent data management. For many applications, the performance, flexibility, and development cost of OODBMSs are significantly better than RDBMSs or ORDBMSs. The chief advantage of OODBMSs lies in the way they can achieve a tighter integration between OO languages and the DBMS. Indeed, the main standards body for OODBMSs, the Object Database Management Group (ODMG) defines an OODBMS as a system that integrates database capabilities with object-oriented programming language capabilities. The idea behind this is that so far as an application developer is concerned, it would be useful to ignore not only questions of how an object is implemented behind its interface, but also how it is stored and retrieved. All developers have to do is implement their application using their favorite OO programming language, such as C++, Smalltalk, or Java, and the OODBMS takes care of data caching, concurrency control, and disk storage. In addition to this seamless integration, OODBMSs possess a number of interesting and useful features derived mainly from the object model. In order to solve the finite type system problem that constrains SQL-92, most OODBMSs feature an extensible type system. Using this technique, an OODBMS can take the complex objects that are part of Evolution of Database Management Systems 7 the application and store them directly. An OODBMS can be used to invoke methods on these objects, either through a direct call to the object or through a query interface. And finally, many of the structural deficiencies in SQL-92 are overcome by the use of OO ideas such as inheritance and allowing sets and arrays. OODBMS products saw a surge of academic and commercial interest in the early 1990s, and today the annual global market for OODBMS products runs at about $50 million per year. In many application domains, most notably computer-aided design or manufacturing (CAD/CAM), the expense of building a monolithic system to manage both database and application is balanced by the kinds of performance such systems deliver. Problems with OODBMS Regrettably, much of the considerable energy of the OODBMS community has been expended relearning the lessons of twenty years ago. First, OODBMS vendors have rediscovered the difficulties of tying database design too closely to application design. Maintaining and evolving an OODBMS-based information system is an arduous undertaking. Second, they relearned that declarative languages such as SQL-92 bring such tremendous productivity gains that organizations will pay for the additional computational resources they require. You can always buy hardware, but not time. Third, they re-discovered the fact that a lack of a standard data model leads to design errors and inconsistencies. In spite of these shortcomings OODBMS technology provides effective solutions to a range of data management problems. Many ideas pioneered by OODBMSs have proven themselves to be very useful and are also found in ORDBMSs. Object-relational systems include features such as complex object extensibility, encapsulation, inheritance, and better interfaces to OO languages. Object-Relational DBMS ORDBMSs synthesize the features of RDBMSs with the best ideas of OODBMSs. Although ORDBMSs reuse the relational model as SQL interprets it, the OR data model is opened up in novel ways. New data types and functions can be implemented using general-purpose languages such as C and Java. In other words, ORDBMSs allow developers to embed new classes of data objects into the relational data model abstraction. 8 Chapter One Introduction to Object-Relational Database Development ORDBMS schema have additional features not present in RDBMS schema. Several OO structural features such as inheritance and polymorphism are part of the OR data model. ORDBMSs adopt the RDBMS query-centric approach to data management. All data access in an ORDBMS is handled with declarative SQL statements. There is no procedural, or object-at-a-time, navigational interface. ORDBMSs persist with the idea of a data language that is fundamentally declarative, and therefore mismatched with procedural OO host languages. This significantly affects the internal design of the ORDBMS engine, and it has profound implications for the interfaces developers use to access the database. From a systems architecture point of view, ORDBMSs are implemented as a central server program rather than as a distributed data architectures typical in OODBMS products. However, ORDBMSs extend the functionality of DBMS products significantly, and an information system using an ORDBMS can be deployed over multiple machines. To see what this looks such as, consider again the Employees example. Using an ORDBMS, you would represent this data as shown in Listing 13. CREATE TABLE Employees ( Name PersonName NOT DOB DATE NOT Salary Currency NOT Address StreetAddress NOT PRIMARY KEY ( Name, ); NULL, NULL, NULL, NULL DOB ) Listing 13. Object-Relational Version of Employees Table For readers familiar with relational databases, this CREATE TABLE statement should be reassuringly familiar. An object-relational table is structurally very similar to its relational counterpart and the same data integrity and physical organization rules can be enforced over it. The difference between object-relational and relational tables can be seen in the section stipulating column types. In the object-relational table, readers familiar with RDBMSs should recognize the DATE type, but the other column types are completely new. From an object-oriented point of view, these types correspond to class names, which are software modules that encapsulate state and (as we shall see) behavior. As another example of the ORDBMS data model's new functionality, consider a company supplying skilled temporary workers at short notice. Such a company would need to record each employee's resumes, the geographic location where they live, and a set of Periods (fixed intervals in the time line) during which they are available, in Evolution of Database Management Systems 9 addition to the regular employee information. Listing 14 illustrates how this is done. CREATE TABLE Temporary_Employees ( Resume DOCUMENT NOT NULL, LivesAt GEOPOINT NOT NULL, Booked SET( Period NOT NULL ) ) UNDER Employees; Listing 14. Object-Relational Version of the Temporary_Employees Table 1 Readers familiar with earlier RDBMS releases of Informix Dynamic Server (IDS) will also be struck by the use of the UNDER keyword. UNDER signifies that the Temporary_Employees table inherits from the Employees table. All the columns in the Employee table are also in the Temporary_Employees table, and the rows in the Temporary_Employees table can be accessed through the Employee table. Answering business questions about temporary employees requires that the information system be able to support concepts such as "Is Point in Circle," "Is Word in Document," and "Is some Period Available given some set of Booked Periods." In the IDS product such behaviors are added to the query language. In Listing 15, we present a query demonstrating OR-SQL. "Show me the names of Temporary Employees living within 60 miles of the coordinates (-122.514, 37.221), whose resumes include references to both INFORMIX and `database administrator,' and who are not booked for the period between today and seven days ahead." SELECT Print(E.Name) FROM Temporary_Employees E WHERE Contains (GeoCircle('(-122.514, 37.221)', '60 miles')), E.LivesAt ) AND DocContains ( E.Resume, 'INFORMIX and Database Administrator') AND NOT IsBooked ( Period(TODAY, TODAY + 7), E.Booked ); Listing 15. Object-Relational Query against the Employees Table 1 Note that this is illegal syntax. This figure is intended to illustrate a data modeling principle, rather than to demonstrate a use of OR-SQL. Refer to Chapter 2 for more details. 10 Chapter One Introduction to Object-Relational Database Development Again, many readers will be familiar with the general form of this SELECT statement. But this query contains no expressions that are defined in the SQL-92 language standard. In addition to accommodating new data structures, an ORDBMS can integrate logic implementing the behavior associated with the objects. Each expression, or function name, in this query corresponds to a behaviorial interface defined for one of the object classes mentioned in the table's creation. Developing an object-relational database means integrating whatever the application needs into the ORDBMS. The examples in Listings 15 and 16 are both obvious extensions of SQL. But an ORDBMS is extensible in other ways too. Tables in an objectrelational database can be more than data storage structures. They can be active interfaces to external data or functionality. This allows you, for example, to integrate software that interfaces with a paging system directly into the ORDBMS, and use it as shown in Listing 16. "Send a page to all Temporary_Employees living within 60 miles of the coordinates (-122.514, 37.221), whose resumes includes references to both INFORMIX and `database administrator,' and who are not booked for the period between today and seven days ahead." INSERT INTO SendPage ( Pager_Number, Pass_Code, Message ) SELECT E.Pager_Number, E.Pass_Code, Print(E.Name) || ': Call 1-800-TEMPS-R-US for immediate INFORMIX DBA job' FROM Temporary_Employees E WHERE Contains (GeoCircle('(-122.514, 37.221)', '60 miles')), E.LivesAt ) AND DocContains ( E.Resume, 'INFORMIX and Database Administrator') AND NOT IsBooked ( Period(TODAY, TODAY + 7), E.Booked ); Listing 16. Object-Relational Query Illustrating External Systems Integration In a SQL-92 DBMS, SendPage could be only a table. The effect of this query would then be to insert some rows into the SendPage table. However, in an ORDBMS, SendPage might actually be an active table, which is an interface to the communications system used to send elec- Evolution of Database Management Systems 11 tronic messages. The effect of this query would then be to communicate with the matching temporary workers! Object-Relational DBMS Applications Extensible databases provide a significant boost for developers building traditional business data processing applications. By implementing a database that constitutes a better model of the application's problem domain the information system can be made to provide more flexibility and functionality at lower development cost. Business questions such as the one in Listing 16 might be answered in systems using an SQL-92 and C. Doing so, however, involves a more complex implementation and requires considerably more effort. The more important effect of the technology is that it makes it possible to build information systems to address data management problems usually considered to be too difficult. In Table 11, we present a list of applications that early adopters of ORDBMS technology have built successfully. Other technology changes are accelerating demand for these kinds of systems. One way to characterize applications in which an object-relational DBMS is the best platform is to focus on the kind of data involved. For thirty years, software engineers have used the term "data entry" to describe the process by which information enters the system. Human users enter data using a keyboard. Today many information systems employ electronics to capture information. Video cameras, environmental sensors, and specialized monitoring equipment record data in rich media systems, industrial routing applications, and medical imaging systems. Object-relational DBMS technology excels at this kind of application. It would be a mistake to say that ORDBMSs are only good for digital content applications. As we shall see in this book OR techniques provide considerable advantages over more low-level RDBMS approaches even in traditional business data processing applications. But as other technology changes move us towards applications in which data is recorded rather than entered, ORDBMSs will become increasingly necessary. ORDBMS Concepts and Terminology In this section, we introduce some of the terminology used to describe extensible database technology. For reference purposes, this book also 12 Chapter One Introduction to Object-Relational Database Development Table 11. Extensible Database Problem Domains Application Domain Complex data analysis Description You can integrate sophisticated statistical and special purpose analytic algorithms into the ORDBMS and use them in knowledge discovery or data mining applications. For example, it is possible to answer questions such as "Which attribute of my potential customers indicates most strongly that they will spend money with me?" Simple cases, such as Listing 15, permit you to find all documents that include some word or phrase. More complex uses would include creating a network that reflected similarity between documents. Text and documents Digital asset management The ORDBMS can manage digital media such as video, audio, and still images. In this context, manage means more than store and retrieve. It also means "convert format," "detect scene changes in video and extract first frame from new scene," and even "What MP3 audio tracks do I have that include this sound?" Geographic data For traditional applications, this might involve "Show me the lat/long coordinates corresponding to this street address." This might be extended to answer requests such as "Show me all house and contents policy holders within a quarter mile of a tidal water body." For next-generation applications, with a GPS device integrated with a cellular phone, it might even be able to answer the perpetual puzzler "Car 54, where are you?" Modern medicine gathers lots of digital signal data such as CAT scans and ultrasound imagery. In the simplest case, you can use these images to filter out "all cell cultures with probable abnormality." In the more advanced uses, you can also answer questions such as "show me all the cardiograms which are `like' this cardiogram." Bio-medical includes a glossary that defines much of the language you will encounter. Subject areas corresponding to each heading in this section are covered in much more detail in later chapters. Note that this book goes beyond merely describing ORDBMS technology. It also contains chapters dealing with subjects such as OR database analysis and schema design, as well as the detailed ins and outs of writing your own user-defined extensions. ORDBMS Concepts and Terminology 13 Data Model A data model is a way of thinking about data, and the object-relational data model amounts to objects in a relational framework. An ORDBMS's chief task is to provide a flexible framework for organizing and manipulating software objects corresponding to real-world phenomenon. 14 Chapter One Introduction to Object-Relational Database Development The object-relational data model can be broken into three areas: Structural Features. This aspect of the data model deals with how a database's data can be structured or organized. Manipulation. Because a single data set often needs to support multiple user views, and because data values need to be continually updated to reflect the state of the world, the data model provides a means to manipulate data. Integrity and Security. A DBMS's data model allows the developers to declare rules that ensure the correctness of the data values in the database. In the first two chapters of this book, we introduce and describe the features of an ORDBMS that developers use to build information systems. We then spend two chapters describing the second important aspect of the ORDBMS data model: user-defined type and function extensibility. Enhanced Table Structures An OR database consists of group a of tables made up of rows. All rows in a table are structurally identical in that they all consist of a fixed number of values of specific data types stored in columns that are named as part of the table's definition. The most important distinction between SQL-92 tables and object-relational database tables is the way that ORDBMS columns are not limited to a standardized set of data types. Figure 12 illustrates what an object-relational table looks like. The first thing to note about this table is the way that its column headings consist of both a name and a data type. Second, note how several columns have internal structure. In a SQL-92 DBMS, such structure would be broken up into several separate columns, and oper- People Name::PersonName ( Grossmann , Marcel ) ( Millikan , Robert ) ( Mach , Ernst ) ( Ishiwara , Jun ) DOB::date Employees Name::PersonName ( Einstein , Albert ) ( Curie , Marie ) ( Planck , Max ) ( Hilbert , David ) DOB::date 03-14-1879 Salary::Currency DM125,000 F125,000 DM115,000 SF210,000 Address::MailAddress ( 12 Gehrenstrasse. . ) ( 19a Rue de Seine . . ) ( 153 Volkenstrasse . ) ( 10 Geneva Avenue . ) LivesAt::GeoPoint () () () () Resume::Document Physics, theoretical . . . Physics, experimental . . . Physics, experimental . . Mathematics, politics. . . Figure 13. Inheritance in an Object-Relational Database ORDBMS Concepts and Terminology 15 ations over a data value such as Employee's Name would need to list every component column. Third, this table contains several instances of unconventional data types. LivesAt is a geographic point, which is a latitude/longitude pair that describes a position on the globe. Resume contains documents, which is a kind of Binary Large Object (BLOB). Employees Name::PersonName (`Einstein','Albert') (`Curie','Marie') (`Planck','Max') (`Hilbert','David') DOB::date 03-14-1879 11-07-1867 04-23-1858 01-23-1862 Address::MailAddress ('12 Gehrenstrasse . . ) (`19a Rue de Seine . . ) (`153 Volkenstrasse . ) ('10 Geneva Avenue . ) LivesAt::Point `( -127.4, 45.1 )' `( -115.3, 27.5 )' `( -121.8, 31.1 )' `(-119.2,37.81)' Resume::Document `Physics, theoretical `Physics, experimental `Physics, experimental `Mathematics, politics Figure 12. Structure and Data for an Object-Relational Table In addition to defining the structure of a table, you can include integrity constraints in its definition. Tables should all have a key, which is a subset of attributes whose data values can never be repeated in the table. Keys are not absolutely required as part of the table's definition, but they are a very good idea. A table can have several keys, but only one of these is granted the title of primary key. In our example table, the combination of the Name and DOB columns contains data values that are unique within the table. On balance, it is far more likely that an end user made a data entry mistake than two employees share names and dates of birth. Object-Oriented Schema Features Another difference between relational DBMSs and ORDBMSs is the way in which object-relational database schema supports features co-opted from object-oriented approaches to software engineering. We have already seen that an object-relational table can contain Temporary_Employees Name::PersonName (`Szilard','Leo') (`Fermi','Enrico') DOB::date `2/11/1898' `9/29/1901' Booked::SET( Period NOT NULL) { `[ 6/15/1943 6/21/1943 ]','[ 8/21/1943 9/22/1943 ]'} { `[ 6/10/1938 10/10/1939 ]',`[ 6/15/1943 12/1/1945]', `[9/15/1951 9/21/1951]' } Figure 14. Non-First Normal Form (nested Relational) Table Structure 16 Chapter One Introduction to Object-Relational Database Development exotic data types. In addition, object-relational tables can be organized into new kinds of relationships, and a table's columns can contain sets of data objects. In an ORDBMS, tables can be typed; that is, developers can create a table with a record structure that corresponds to the definition of a data type. The type system includes a notion of inheritance in which data types can be organized into hierarchies. This naturally supplies a mechanism whereby tables can be arranged into hierarchies too. Figure 13 illustrates how the Employees table in Figure 12 might look as part of such a hierarchy. In most object-oriented development environments, the concept of inheritance is limited to the structure and behavior of object classes. However, in an object-relational database, queries can address data values through the hierarchy. When you write an OR-SQL statement that addresses a table, all the records in its subtables become involved in the query too. Another difference between ORDBMSs and traditional relational DBMSs can be seen in the Booked column of the Temporary_Employees table. The table in Figure 14 illustrates how this might look. SQL-92 DBMS columns can contain at most one data value. This is called the first normal form constraint. In a traditional RDBMS, situations in which a group of values are combined into a single data object, are handled by creating an entirely separate table to store the group. In an ORDBMS this group of values can be carried in rows using a COLLECTION, which can contain multiple data values. In Chapter 2 we explain how to create table hierarchies and tables with COLLECTION columns. In Chapter 3 we explain how they are integrated into the query language, and in Chapter 4, we explain the part they play in the extensible type system. Table 12. Data Type Extensibility: Partial List of Functions for Geographic Quadrilateral Data Type Data Type: GeoQuad Expression: GeoQuad( GeoPoint, GeoPoint ) Explanation: Constructor function. Takes two corner points and produces a new Quadrilateral data type instance. Example Query: INSERT INTO QuadTable VALUES ( GeoQuad ( `(0,0)', '(10,10)' ) ); (continued) ORDBMS Concepts and Terminology 17 Table 12. Data Type Extensibility: Partial List of Functions for Geographic Quadrilateral Data Type (continued) Data Type: GeoQuad Expression: GeoQuad ( double, double, double, double ) Explanation: Constructor function. Takes four doubles that correspond to the X and Y values of the lower left and upper right corner. Operator function. Returns true if the first point falls within the geographic extent of the quadrilateral. Example Query: SELECT GeoQuad (MIN(X), MIN(Y), MAX(X), MAX(Y) ) FROM Locations; SELECT COUNT(*) FROM QuadTable T WHERE Contains( `(5,5)', T.Quad); Contains ( GeoPoint, GeoQuad ) Union ( GeoQuad, GeoQuad ) Support function that computes a new quadrilateral based on the furthest corners of the two quadrilaterals inputs. Constructor function. Creates new GeoQuad using the string. A symmetric function implements the reverse. Constructor function. Creates new GeoQuad using the string. A symmetric function implements the reverse. Used internally by the ORDBMS as part of R-Tree indexing. GeoQuad ( String ) Used to convert literal strings in queries into the internal format for the type. GeoQuad ( String ) Used to convert literal strings in queries into the internal format for the type. The ORDBMS data model is considerably richer than the RDBMS data model. Unfortunately, this new richness complicates database design. There are more alternative designs that can be used to represent a particular situation, and it is not always obvious which to pick. Unthinkingly applying some of these features, such as the COLLECTION columns, creates problems. However there are data modeling problems for which a COLLECTION is an elegant solution. An important objective of this book is to provide some guidance on the subject of object-relational database design. Chapters 8 and 9 are devoted to questions of analysis and design. 18 Chapter One Introduction to Object-Relational Database Development Extensibility: User-Defined Types and User-Defined Functions The concept of extensibility is a principal innovation of ORDBMS technology. One of the problems you encounter developing information systems using SQL-92 is that modeling complex data structures and implementing complex functions can be difficult. One way to deal with this problem is for the DBMS vendor to build more data types and functions into their products. Because the number of interesting new data types is very large, however, this is not a reasonable solution. A better approach is to build the DBMS engine so that it can accept the addition of new, applicationspecific functionality. Developers can specialize or extend many of the features of an ORDBMS: the data types, OR-SQL expressions, the aggregates, and so on. In fact, it is useful to think of the core ORDBMS as being a kind of software backplane, which is a framework into which specialized software modules are embedded. Data Types SQL-92 specifies the syntax and behavior for about ten data types. SQL-3, the next revision of the language, standardizes perhaps a hundred more, including geographic, temporal, text types, and so on. Support for these common extensions is provided in the form of commercial DataBladeTM products. A separate tutorial in this book described the range of currently shipping DataBladeTM products. However, relying on the DBMS vendor to supply all of the innovation does not address the fundamental problem. Reality is indifferent to programming language standards. With an object-relational DBMS developers can implement their own application specific data types and the behavior that goes with them. Table 12 lists some of the expressions added to the OR-SQL language to handle a geographic quadrilateral data type (an object with four corner points and parallel opposite edges). To extend the ORDBMS with the GeoQuad type introduced in Table 12, a programmer would: 1. Implement each function in one of the supported procedural languages: C, Java, or SPL. 2. Compile those programs into runnable modules (shared executable libraries or Java JAR files) and place the files somewhere that the ORDBMS can read them. 3. Declare them to the database using the kind of syntax shown in Listing 17. ORDBMS Concepts and Terminology 19 CREATE OPAQUE TYPE GeoQuad ( internallength = 32 ); -CREATE FUNCTION GeoQuad ( lvarchar ) RETURNING GeoQuad WITH ( NOT VARIANT, PARALLELIZABLE ) EXTERNAL NAME "$INFORMIXDIR/extend/2DSpat/2DSpat.bld(GeoQuadInput)" LANGUAGE C; -CREATE CAST ( lvarchar AS GeoQuad WITH GeoQuad ); -CREATE FUNCTION GeoQuad ( double precision, double precision, double precision, double precision ) RETURNING GeoQuad WITH ( NOT VARIANT, PARALLELIZABLE ) EXTERNAL NAME "$INFORMIXDIR/extend/2DSpat/2DSpat.bld(GeoQuadFromDoubles )" LANGUAGE C; Listing 17. Data Type Extensibility: Partial SQL Declaration of User-Defined Data Type with External Implementation in C In Chapters 4 and 5, we describe the extent of this functionality, and in Chapter 10, we spend considerable time on the question of how to use C to implement the fastest possible data type extensions. A special Java tutorial explores how to achieve the same thing using the JavaTM language, and the SQL-J standard. SQL-92 includes some general-purpose analytic features through its aggregates (MIN, MAX, COUNT, AVG, and so on). Aggregate functions can be used in conjunction with other aspects of SQL-92 to answer questions about groups of data. For example, the query in Listing 18 uses the SQL-92 table to find out what is the mean salary of each group of Employees in different cities. "What is the average salary of Employees for each of the cities where they live?" SELECT E.City, AVG(E.Salary) FROM Employees E GROUP BY E.City; 20 Chapter One Introduction to Object-Relational Database Development Listing 18. Simple Analysis Query Using a SQL-92 Aggregate Function The range of aggregates in SQL-92 is limited. In data mining, and in the larger field of statistical analysis, researchers have described a tremendous number of useful analytic algorithms. For example, it might make more sense to calculate the median salary, rather than the mean salary, in the query above. Or it might be more useful to create a histogram showing how many employees fall into certain ranges of salaries. SQL-92 does not provide the means to answer such analytic questions directly. With the ORDBMS, however, these algorithms can be integrated into the server and used in the same way as built-in aggregates. The OR-SQL query in Listing 19 uses the Employees table defined in Listing 1 4. It calculates the correlation between the number of words in an Employees resume and his or her salary. "What is the correlation coefficient between Employee salaries and the number of words in their resumes?" SELECT Correlation ( E.Salary, ) ) FROM Employees E; WordCount( E.Resume Listing 19. Analysis Query with a User-Defined Aggregate (Correlation) In this book we take the view that an aggregate is a special kind of function, so we introduce the idea in Chapter 6. However, much of the detailed material external C description in Chapter 10 is also relevant to user-defined aggregates. Database Stored Procedures Almost all RDBMSs allow you to create database procedures that implement business processes. This allows developers to move considerable portions of an information system's total functionality into the DBMS. Although centralizing CPU and memory requirements on a single machine can limit scalability, in many situations it can improve the system's overall throughput and simplify its management. By implementing application objects within the server, using Java, for examples, it becomes possible, though not always desirable, to push code implementing one of an application-level object's behaviors into the ORDBMS. The interface in the external program simply passes the work back into the IDS engine. Figure 15 represents the contrasting approaches. An important point to remember is that with Java, the same logic can be deployed either within the ORDBMS or within ORDBMS Concepts and Terminology 21 ORDBMS Message SQL Queries Data Processing Response User Interface Message DBMS Data OR-SQL Queries Message Data Processing Database Stored Procedure DBMS Data Response User Interface Response Figure 15. Routine Extensibility and the ORDBMS as the Object-Server Architecture an external program without changing the code in any way, or even recompiling it. In Chapter 6, we introduce the novel idea that the ORDBMS can be used to implement many of the operational features of certain kinds of middleware. Routine extensibility, and particularly the way it can provide the kind of functionality illustrated in Figure 15, is a practical application of these ideas. But making such system scalable requires using other features of the ORDBMS: the distributed database functionality, commercially available gateways, and the open storage manager (introduced below). Combining these facilities provides the kind of location transparency necessary for the development of distributed information systems. Storage Management Traditionally the main purpose of a DBMS was to centralize and organize data storage. A DBMS program ran on a single, large machine. It would take blocks of that machine's disk space under its control and store data in them. Over time, RDBMS products came to include ever more sophisticated data structures and ever more efficient techniques for memory caching, data scanning, and storage of large data objects. In spite of these improvements, only a fraction of an organization's data can ever be brought together into one physical location. Data is often distributed among many systems, which is the consequence of 22 Chapter One Introduction to Object-Relational Database Development Conventional DBMS Table ORDBMS Built-In Data Management Facilities Queries against ORDBMS "Tables" Built-in Storage Structures User Interface Table Created Using User-Defined Access Method Extended Access Method Functions External Data Source: File-System, Pager Interface, etc. Figure 16. Extensible Storage Manager autonomous information systems development using a variety of technologies, or through organizational mergers, or because the data is simply not suitable for storage in any DBMS. To address this, the IDS product adds a new extensible storage management facility. In Figure 16, we illustrate this Virtual Table Interface concept. ORDBMSs possess storage manager facilities similar to RDBMSs. Disk space is taken under the control of the ORDBMS, and data is written into it according to whatever administrative rules are All specified. the indexing, query processing, and cache management techniques that are part of an RDBMS are also used in an ORDBMS. Further, distributed database techniques can be adapted to incorporate user-defined types and functions. However, all of these mechanisms must be re-implemented to generalize them so that they can work for user-defined types. For example, page management is generalized to cope with variable length OPAQUE type objects. You can also integrate code into the engine to implement an entirely new storage manager. Developers still use OR-SQL as the primary interface to this data, but instead of relying on internal storage, the ORDBMS can use the external file system to store data. Any data set that can be represented as a table can be accessed using this technique. ORDBMS Concepts and Terminology 23 Developers can also use this technique to get a snapshot of the current state of live information. It is possible to represent the current state of the operating system's processes or the current state of the file system as a table. You can imagine, for example, an application intended to help manage a fleet of trucks and employees servicing air conditioners or elevators. Each truck has a device combining a Global Positioning System (GPS) with a cellular phone that allows a central service to poll all trucks and to have them "phone in" their current location. With the ORDBMS, you can embed Java code that activates the paging and response service to implement a virtual table, and then write queries over this new table, as shown in Listing 110. "Find repair trucks and drivers within '50 miles' of `Alan Turing' who are qualified to repair the `T-20' air conditioning unit." SELECT FROM WHERE AND AND T.Location, T.DriversName Trucks T, Customers C Distance (T.Location, C.Location) < '50 miles' C.Name = 'Alan Turing' DocContains ( T.DriverQualifications, 'Repair for T-20'); Listing 110. Query Reaching to Data Outside the ORDBMS This functionality should fundamentally change the way you think about a DBMS. In an object-relational DBMS, SQL becomes the medium used to combine components to perform operations on data. Most data will be stored on a local disk under the control of the DBMS, but that is not necessarily the case. The Virtual Table Interface tutorial describes these features in more detail. Distributed Deployment Often the volume of data in a single information system, or the workload imposed by its users, is too much for any one computer. Storing shared data, and providing efficient access to it, requires that the system be partitioned or distributed across several machines. Combining 2 It is worth noting that whether this turns them into object-relational systems is still an open question. The internal design of an ORDBMS is greatly influenced by the need to support declarative operations in a transactional system. Retrofitting either of these functions to a system that was not designed primarily to support them has been shown to be extremely difficult. 24 Chapter One Introduction to Object-Relational Database Development Web Server Distributed ORDBMS Nodes HTTP Messages Centralized Data Repository Figure 17. Distributed Information System Deployment extensibility with distributed database features makes new system architectures possible. This concept is illustrated in Figure 17. This figure illustrates a Web site configuration. A large central machine contains canonical copies of all data. Surrounding it is a cloud of other, smaller installations. These might cache replicated (read only) copies of a sub-set of the total data. All this data and all the modules of logic implementing the various extended types and functions can be queried from everywhere. The effect of this kind of architecture is to distribute the load across several machines, without compromising from data integrity. In Chapter 6, we discuss the distributed query and replication features that make this kind of deployment possible. Ad-Hoc Query Language You manipulate data stored in an ORDBMS using an extended version of the SQL declarative data language that we call OR-SQL. OR-SQL is a reasonably complete implementation of a declarative relational language. We say it is declarative because OR-SQL expres- ORDBMS Concepts and Terminology 25 sions describe what it is that is wanted, rather than a procedural, step-by-step algorithm defining how the task is to be accomplished. OR-SQL expressions are strings that the ORDBMS can parse, optimize, and execute at runtime. We say OR-SQL is relational because it expresses operations over relational schema objects such as tables and views. OR-SQL statements are value-oriented. Queries make no reference to physical data management details, such as pointers, or to memory management. In fact, the same OR-SQL statement can be processed internally by the ORDBMS in many different ways. The actual operational schedule depends on factors such as the physical configuration of the database, the presence of indices on certain columns, the number of rows the ORDBMS needs to manage at various stages of the query processing, and so on. Using declarative, value-oriented interfaces to database data distinguishes ORDBMSs from most OODBMSs. OODBMSs traditionally rejected query-centric interfaces as being too cumbersome. Recently, the OODBMS community has moved to embrace the Object Query Language (OQL) as a standard declarative interface to their systems.2 But OR-SQL is such likely to be the dominant language because SQL is "inter-galactic database speak." The OR-SQL implemented in IDS is a very different language from what is described in the SQL-92 language standard. The SQL-92 standard provides a definition for an entire language: a grammar, keywords, a set of data types, and a list of language expressions that can be used with these types. The OR-SQL philosophy is somewhat different. Although the same four basic data operations present in SQL-92--INSERT, DELETE, UPDATE and SELECT--form the basis of OR-SQL, the rest of the language is left "as an exercise for the implementor." Listings 15 and 110 show examples of ORDBMS SELECT queries. In Listing 111, we introduce several queries that manipulate data. "Delete the record associated with Employee Marie Curie." DELETE FROM Employees WHERE Name = PersonName('Curie','Marie') AND DOB = '11-07-1866'; "Update Albert Einstein's Employee record with a new resume taken from the supplied file." UPDATE Employees SET Resume = GetDocument('C:\temp\Albert.doc', 'client') WHERE Name = PersonName('Einstein','Albert') AND DOB = '03-14-1879'; 26 Chapter One Introduction to Object-Relational Database Development "Insert an Employee record for `Ernst Mach'." INSERT INTO Employees ( Name, DOB, Salary, Address, Resume, LivesAt, Booked ) VALUES ( PersonName('Mach','Ernst'), '03-18-1838', Currency(120000.00,'DM'), Address('123 Gehrenstrasse', 'Berlin','GERMANY', 8485), GetDocument('C:\temp\Albert.doc','client'), '(11.54, 47.6722 )'::GeoPoint, SET() ); Listing 111. SQL Write Queries Chapter 2 and Chapter 3 describe OR-SQL in detail. Numerous examples throughout this book illustrate different kinds of query expressions. Readers wanting more information on how to write OR-SQL are advised to consult the many books on SQL-92. Obviously, these books overlook OR-SQL specific issues, but the way they generally talk about using SQL remains valid. Application Programming Interfaces There is always more to an information system than a database. Other, external programs are responsible for communication and for managing user interfaces. An information system will use a variety of languages to implement the non-DBMS parts of the final system. Consequently, there are several mechanisms for handling applications programming interfaces (API). OR-SQL queries can be embedded into external programs and then passed into the ORDBMS at runtime. In return, the ORDBMS sends result data to the external program. Another, very powerful way to use SQL is to write logic that actually creates SQL queries based on enduser input. Tools such as Microsoft Access, although they do not take advantage of many of the innovative features described in this book, epitomize this approach. The most traditional API approach involves embedding OR-SQL statements directly into C programs and using a pre-parser to turn embedded OR-SQL into a procedural program. More recent approaches involve functional interfaces such as ODBC and the JDBC standard for Java programs. For Web applications, you can use mark-up tags that convey to the Web server that a OR-SQL query needs to be executed and its results formatted according to a set of mark-up rules. ORDBMS Advantages 27 We describe three of these interfaces, ESQL/C, JDBC and the Web Blade, in detail in Chapter 7. Another interface--the Server API, or SAPI--is used by C logic executing within the ORDBMS. We do not cover the SAPI OR-SQL facilities in this book. ORDBMS Advantages Why is all of this useful? What advantages does this give you? ORDBMS technology improves upon what came before it in three ways. The first improvement is that can enhance a system's overall performance. The IDS product can achieve higher levels of data throughput or better response times than is possible using RDBMS technology and external logic because ORDBMS extensibility makes it possible to move logic to where the data resides, instead of always moving data to where the logic is running. This effect is particularly pronounced for dataintensive applications such as decision support systems and in situations in which the objects in your application are large, such as digital signal or time series data. But in general, any application can benefit. The second improvement relates to the way that integrating functional aspects of the information system within the framework provided by the ORDBMS improves the flexibility of the overall system. Multiple Client Client Client Client Client Client Middle-Ware Logic SQL-92 DBMS Middle-Ware Logic Object-Relational DBMS Logic Data Storage Data Storage Figure 18. Alternative Extensible Architectures 28 Chapter One Introduction to Object-Relational Database Development Table 13. Latency Timings for Low-Level Data Movement Operations Operation Random disk read or write Local area network (LAN) Interprocess communication Block memory copy Typical Mechanism Involved fopen(), read(), write(), seek(), and so on Sockets pipes and shared memory Memcpy ~Latency (secs) 0.01 0.000 1 0.000 001 0.000 000 01 unrelated object definitions can be combined within a single ORDBMS database. At runtime, they can be mingled within a query expression created to answer some high-level question. Such flexibility is very important because it reduces the costs associated with information system development and ongoing maintenance. The third benefit of an ORDBMS relates to the way information systems are built and managed. An ORDBMS's system catalogs become a metadata repository that records information about the modules of programming logic integrated into the ORDBMS. Over time, as new functionality is added to the application and as the programming staff changes, the system's catalogs can be used to determine the extent of the current system's functionality and how it all fits together. The fourth benefit is that the IDS product's features makes it possible to incorporate into the database data sets that are stored outside it. This allows you to build federated databases. From within single servers, you can access data distributed over multiple places. In this section of the chapter, we explain each advantage in detail and in turn. Performance It is important to understand that in a well-implemented extensible DBMS, the code you embed within it does not run on a client machine or in a middle-ware layer wrapped around the database core. Rather, the code runs inside the ORDBMS engine, as close as possible to where the data is stored. Figure 18 illustrates the difference. 3 Register caching on modern CPUs is adding another level of performance difference. In general it can be 10 to 100 times as expensive to read data from RAM than from a register. ORDBMS Advantages 29 The diagram on the left illustrates how procedural logic and relational databases are deployed today. Consider what happens when you need to apply some kind of complex logic to distinguish interesting rows in a table from uninteresting ones. Achieving this with SQL-92 requires that each row retrieved from the DBMS be filtered using logic in the middle-ware. On the right, the OR approach is presented. Here, the filtering logic is embedded within the ORDBMS and invoked as part of query processing. Moving logic into the ORDBMS can have significant performance benefits. To explain why, we first need to introduce some of the basic performance properties of computer systems. Table 13 lists the approximate latencies of several common, low-level operations. Each row of this table corresponds to a data movement operation, and each latency time reflects the average amount of time taken to perform the operation on 1 K of data. You can think of these as per-operation taxes paid to the operating environment and computer hardware. Some of these numbers are fairly obvious and are included as references. Their relative sizes are due to the fundamental physics involved. The reason that it takes such an enormous amount of time (relatively speaking) to move data from magnetic disk into physical memory is because this is the only stage in the data management food chain that involves mechanical movement. At the other extreme, mempy() compiles down to a handful of low-level instructions that are executed very quickly.3 Between these extremes, moving data across a local-area network requires that you involve your computer's operating system, which in turn needs to interact with the networking hardware, and then the remote computer's operating system, often many times. Similarly, the time taken even to move data between two processes running on the same computer is significantly longer than the memcpy(). This is due to the operating system's mediation of the exchange. Such a transfer involves many more instructions and necessitates several process context switches. The implication of this is obvious: the less you move data, the less overhead you incur, and the better your overall system performs. Of course, some data movement is unavoidable. Data must travel from its disk storage to where the user's eyeballs can see it. A good design principle to adopt, however, is to position the functional modules of your system in such a way that you minimize the volume of data being moved about by the information system's workload. By providing the ability to host more procedural logic adjacent to the data, the ORDBMS opens up new possibilities, especially in the newer kinds of applications. 30 Chapter One Introduction to Object-Relational Database Development Working an Example A major financial customer saw the performance possibilities of ORDBMSs early. Their problem was in calculating the value of certain complex financial instruments. Slightly simplified, the data they were dealing with was stored as shown in Listing 112. CREATE TABLE Instruments ( ID INTEGER PRIMARY KEY, Portfolio INTEGER Issuer VARCHAR(32) Issuer_Class CHAR(4) Principal MONEY Issue_Date DATE Rate FLOAT ); NOT NULL NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL Listing 112. Table for Financial Instrument Data The primary purpose of the application was to how much a particular portfolio (a set of instruments) was worth. Calculating this value required figuring out the value of each instrument in the portfolio on some date, and then adding up all the values. To solve this problem, they wrote the program in Listing 113. dec_t * CalculatePortfolioValue ( EXEC SQL BEGIN DECLARE SECTION; PARAMATER integer Portfolio_Argument; EXEC SQL END DECLARE SECTION; { EXEC SQL BEGIN DECLARE SECTION; dec_t * decTotal; EXEC SQL BEGIN DECLARE SECTION; DecTotal = malloc( sizeof(dec_t) ); EXEC SQL DECLARE Curs1 CURSOR FOR SELECT Issuer_Class, Principal, Issue_Date, Rate 4 For the record, these were linear algebra operations: find the dot product of a matrix of correlation coefficients and a vector of values supplied with the instrument. FROM Instruments ORDBMS Advantages 31 WHERE Portfolio = :Portfolio_Argument; EXEC SQL OPEN UpdCurs1 Curs; while(1) { EXEC SQL FETCH Upd_Curs INTO :chIssuer,:decPrincipal, :nIssueDate, :fRate; if ((ret = exp_chk("fetch", 1)) == 100) break; decTotal = decadd ( decTotal, CalcValue (chIssuer, decPrincipal, nIssueDate, fRate )); } EXEC SQL Close Curs1; return decTotal; } Listing 113. External Code for Portfolio Calculation Figuring out how much something is worth is never simple. The most valuable part of this program was the CalcValue() function, which we do not show here. CalcValue() was quite complex (and secret) because the firm had figured out how to incorporates the risk of the issuer defaulting into its calculations of an instrument's value. Government instruments, having no risk of default, generate predictable income. On the other hand, debt issued by riskier organizations tends to have higher nominal returns, but sometimes the lender may go broke. Intuitively, you consider money deposited in a bank account quite differently from money lent to an unreliable relative. Internally, CalcValue() used a number of rather sophisticated mathematical procedures. These made it extremely difficult to implement the calculation using the stored procedure language.4 The financial firm's idea was to take that CalcValue() function and to integrate it into IDS. This reduced the whole code fragment in Listing 113 to what is shown in Listing 114. "What is the total value of Instruments in portfolio X?" SELECT SUM ( CalcValue (Issuer_Class, Principal, Issue_Date, Rate )) FROM Instruments WHERE Portfolio =:Portfolio_Argument; 32 Chapter One Introduction to Object-Relational Database Development Listing 114. Object-Relational SQL for Portfolio Calculation The performance improvement was spectacular. Calculating a portfolio's value was reduced from about two hours to about ten minutes. The difference was entirely due to the reduction in data movement, and also to the way that the ORDBMS could take advantage of parallelism while processing this query. Instead of moving all the matching rows from the Instruments table out of the DBMS, the calculation was instead performed "in place." Flexibility and Functionality Explaining flexibility is more difficult because the advantages of flexibility are harder to quantify. But it is probably more valuable than performance over the long run. To understand why, let's continue with the financial company example. As it turned out, the more profound result of the integration effort undertaken by our financial firm was that the CalcValue() operation was liberated from its procedural setting. Before, developers had to write and compile (and debug) a procedural C program every time they wanted to use CalcValue() to answer a business question. With the ORDBMS, they found that they could simply write a new OR-SQL query instead. For example, the query in Listing 115 is a join involving a table that, while in the database, was beyond the scope of the original (portfolio) problem. "What is the SUM() of the values of instruments in our portfolio grouped by region and sector?" SELECT IS.Country, IS.Region, SUM( CalcValue ( I.Issuer_Class, I.Principal, I.Issue_Date, I.Rate )) FROM Instruments I, Issuers IS WHERE I.Portfolio = :Portfolio_Argument AND I.Issuer = IS.Name GROUP BY IS.Country, IS.Region; Listing 115. Object-Relational SQL for Portfolio Calculation ORDBMS Advantages 33 With the addition of a small Web front end, end users could use the database to find out which was the most valuable instrument in their portfolio or which issuer's instruments performed most poorly, and so on. It was known that the system had the data necessary to answer all these questions before. The problem was that the cost of answering them using C and SQL-92 was simply too high. Maintainability After some investigation, the developers discovered that, over time, there had been several versions of the CalcValue() function. Also, once the CalcValue() algorithm was explained to end users, they had suggestions that might improve it. With the previous system, such speculative changes were extremely difficult to implement. They required a recode-recompile-relink-redistribute cycle. But with the ORDBMS, the alternative algorithms could be integrated with ease. In fact, none of the components of the overall information system had to be brought down. The developers simply wrote the alternative function in C, compiled it into a shared library, and dynamically linked it into the engine with another name. What all of this demonstrates is that the ORDBMS permitted the financial services company to react to changing business requirements far more rapidly than it could before. By embedding the most valuable modules of logic into a declarative language, they reduced the amount of code they had to write and the amount of time required to implement new system functionality. None of this was interesting when viewed through the narrow perspective of system performance. But is made a tremendous difference to the business's operational efficiency. Systems Architecture Possibilities Having implemented several such functions, the next problem confronting the development team was that although their system worked fine, it would be more useful to include data that was stored in another database. In fact, because their operations were international, they needed to transfer data across significant distances and convert data along the way. Bulk copy and load was considered unfeasible, because the remote data was volatile, and although intersite queries were rare, accurate answers were critical. None of the other groups wanted to migrate off their efficient and stable production systems. The basic problem was that the data lived "out there" in flat files, in another information system, or in another DBMS. Nonetheless, the local business users still wanted to access it. 34 Chapter One Introduction to Object-Relational Database Development As an experiment, the developers decided to use the external data access features of the ORDBMS to turn it into a federated database system. Achieving this required a mix of technologies. First, simply getting to the data was a problem. In one case, the data lived in an RDBMS. Fortunately the ORDBMS product possessed a gateway to the other RDBMS. However, the more difficult problem was currency conversion, which was achieved by including routines to perform the translation in the ORDBMS. Another data set was stored in a text file and manipulated by a set of Perl programs. Incorporating this into the database was harder. You might move the flat-file implementation entirely into the ORDBMS, but that would require a rewrite of the Perl scripts. In the end, the developers wrote a very simple interface that created a new storage manager to understand the external file's format and to make its data available through OR-SQL within the ORDBMS. Once this development was complete, the final system looked something like Figure 15. ORDBMS Engineering Another way to answer the question "What is an ORDBMS?" is to describe how an OR engine is constructed. An ORDBMS is an example of what is known as a component-centric software system. It works by allowing developers to combine many different extensions within the framework it provides. In this section, we explain how an ORDBMS works by describing how it processes a query. Along the way, we show you how integrated extensions are managed. Processing an Object-Relational Query When it receives an OR-SQL query, the ORDBMS breaks it up into a series of smaller, simpler operations. Each simple operation corresponds to an algorithm that manipulates a set of row data in some way. An important part of what the ORDBMS does is optimizing these operations. Optimization involves ordering the sequence to minimize the total amount of computer resources needed to resolve the query. Consider the query in Listing 116. "Show me the names of Employees born on January 1st, 1967, and print the list in name order." SELECT E.Name FROM Employees E ORDBMS Engineering 35 WHERE E.DOB = '01-01-1967' ORDER BY E.Name; Listing 116. SQL Example A ORDBMS query processor parses this query and converts it internally into a series of steps, as shown in Listing 117. 1. 2. 3. TABLESCAN( Employees, (DOB = '01-01-1967) ) PROJECT(1., Name) SORT(2., Name) Listing 117. Query Plan In Step 1 of the series, the ORDBMS scans all records in the Employees table. If the record satisfies the predicate that is supplied as the second argument to the TABLESCAN operation (DOB = '01-01-1967'), the matching record is passed into Step 2. In Step 2 the Name column is stripped out of the record and a list consisting of just the names of matching employees is passed into Step 3. In this final step, the names are sorted. The ordered result, the consequence of three separate operations, is returned to the user who submitted the query in the first place. Clearly, there are many opportunities for optimizations here. For example, if an index existed on the Employees.DOB column, the database may elect to use an INDEXSCAN rather than the TABLESCAN. Also, it might be advantageous to use a slightly different plan that strips out Name and DOB query processing before checking if the dateof-birth matches. The complete list of operations--TABLESCAN, INDEXSCAN, PROJECT, JOIN, SORT, UNION, and so on--is quite extensive, and the IDS product includes several different algorithms for performing the same logical operation. Consider the sorting operation, for example. In Don Knuth's The Art of Computer Programming Vol. 3: Sorting and Searching, the author describes over a dozen sorting algorithms, each with slightly different properties. Some work better when the data fits into main memory and others are more efficient when the data must be written to disk. One of the query planner's tasks is to figure out which of the alternate algorithms is the best one in any given circumstance. ORDBMS Evolution from RDBMS Let's look at sorting in more detail. One of the most popular sort algorithms is a called insertion sort. Insertion sort is an O (N2) algorithm. 36 Chapter One Introduction to Object-Relational Database Development Roughly speaking, the time it takes to sort an array of records increases with the square of the number of records involved, so it should only be used for record sets containing less than about 25 rows. But insertion sort is extremely efficient when the input is almost in sorted order, such as when you are sorting the result of an index scan. Listing 118 presents an implementation of the basic insertion sort algorithm for an array of integers. InsertSort( integer arTypeInput[] ) { integer nTypeTemp; integer InSizeArray, nOuter, nInner; nSizeArray = arTypeInput[].getSize(); for ( nOuter = 2; nOuter <= nSizeArray; nOuter ++) { vTypeTemp = arTypeInput[nOuter]; nInner = nOuter - 1; while (( nInner > 0 ) && (arTypeInput[nInner] > vTypeTemp...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

UVA - CS - 453
Client-side Verification of Credit Card Payment Information CS453 Electronic Commerce Fall 2007 Homework #2 JavaScriptAssigned: Thursday, September 13, 2007 Due: by 2pm Thursday, September 27, 2007 via Collab Instructions: Work individually or in a
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design Interaction Diagrams Examples of Collaboration and Sequence Diagrams 2001 T. Horton10/17/01H-1Dynamic Views in UML Class diagrams are models of data types What non-fundamental types are you using? H
UVA - CS - 453
CS 453 Electronic Commerce Technologies Fall 2007 Homework # 4 PHP-based E-StoreAssigned: Sunday, October 28, 2007 Due: Tuesday, November 20, by midnight that evening via electronic submission Credit: 100 points Instructions: You may work in teams
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design On to DesignReminder: Analysis models Earlier we modeled requirements using. Class Diagrams: Known as the Conceptual Model Sometimes known as the logical model. Classes represent domain-level entities. (
UVA - CS - 390
CS290/390: Ethics Case Studies (Feb. 9, 2006)Adopted from Michael Quinns Ethics for the Information Age, 2/e. (Addison-Wesley, 2006) Class activity: The instructor will explain about reading one or more of the cases below and discussing with fellow
UVA - CS - 494
Java Foundation Classes Java Swing, EventsReadings: Just Java 2: Chap 19 &amp; 21, or Eckel's Thinking in Java: Chap 14Slide credits to CMPUT 301, Department of Computing Science University of AlbertaSwing Portable API: The appearance and behavior
UVA - CS - 494
Using Rational Rose to Create Object-Oriented DiagramsThis is a brief overview to get students started in using Rational Rose to quickly create object-oriented models and diagrams. It is not by any means a complete introduction to Rational Rose, but
UVA - CS - 305
CS305, HCI in Software Engineering (formerly Usability Engineering) Beginning of Course Memo for Fall 2008 (version 1.0)Instructor: Dr. Tom Horton. horton(at)cs.virginia.edu 982-2217 Office Hours: MW 3-4:30pm, TTh 1-2pm Class Web site: http:/www.cs.
UVA - CS - 494
CS494 Interfaces and Collection in JavaJava Interfaces Note that the word interface Is a specific term for a language contstruct Is not the general word for communication boundary Is also a term used in UML (but not in C+)1/20/03A2-11/20/
UVA - CS - 305
The Challenge of Designing Interfaces for the Tablet PCPage 1 of 4http:/www.devx.comPrinted from http:/www.devx.com/TabletPC/Article/21302The Challenge of Designing Interfaces for the Tablet PCDesigning a usable interface for a Tablet PC pro
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design UML Class ModelsOverview How class models are used? Perspectives Classes: attributes and operations Associations Multiplicity Generalization and Inheritance Aggregation and composition Later: How to
UVA - CS - 494
CS 494 Adv. SW Design and DevelopmentA Tasting. Course 1: Design patterns: Intro, example Course 2: Inheritance, Interfaces, OO DesignReading Assignment Read for understanding (code if it helps) Basic Java program structure Classes and files;
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design Evaluating Class Diagrams Topics include: Cohesion, Coupling Law of Demeter (handout) Generalization and specialization Generalization vs. aggregation Other aggregation issuesCohesion How diverse are
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design Using PARTS to Illustrate Requirements ConceptsExamples based on PARTS Proposed software system: Project Artifact Report Tracking System (PARTS) PARTS' concept is very similar to commercial defecttracking
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design Software Architecture and DesignReadings: Ambler, Chap. 7(Sections 7.1-7.3 to start - some of this is on detailed design.)What is Design? Specification Is about What, and Design is the start of the How I
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design Design PatternsReadings Chapter 1 of GoF book Especially pp. 1-10, 24-26 I'll get this to you (toolkit, reserve, Web?) Eckel's Thinking in Patterns, on Web Chap. 1, &quot;The pattern concept&quot; Chap. 5, &quot;Fac
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design Course IntroductionDr. Tom Horton Email: horton@virginia.edu Phone: 982-2217 Office Hours: Mon. &amp; Wed., 3:30-5 p.m. and Thur. 2-3:30 (or by appointment) Office: Olsson 228B 2001 T. HortonCourse Overview O
UVA - CS - 494
CS 494 Object-Oriented Analysis &amp; Design Requirements and Use CasesBTW. Specification Documents Steven McConnell (IEEE Software, Oct. 2000) says any of the following are called &quot;requirements document&quot;: Half-page summary of software product vision
UVA - CS - 494
Chuck Allison Featurehttp:/www.cuj.com/sub/special.htmlWhat's New in Standard C+ by Chuck AllisonStandard C+ is finally real, after nine years in the making. Chuck supplies a quick guided tour of the end result. Its official! On July 20, 1998, a
UVA - CS - 390
Computer Architecture in an Era of Multi-Core ChipsKevin Skadron Univ. of Virginia Dept. of Computer Science LAVA LabA New Era of Multi-Core Architectures 2006, Kevin Skadronvs. 2006, Kevin SkadronSource: Chrostopher Reeve Homepage, http:/
UVA - CS - 305
CS305: Introducing Evaluation Readings: from IDbook: Sections 12.1, 12.2, 12.3, 12.5 Section 12.4: definitely 12.4.3 and 12.4.4 Assignment: HW1: Evaluation Homework (more info here in these slides)Where We Are. We've covered: Usability goal
UVA - EVSC - 466
Map Projections Posterhttp:/mac.usgs.gov/mac/isb/pubs/MapProjections/projections.html| The Globe | Mercator | Transverse Mercator | Oblique Mercator | Space Oblique Mercator | | Miller Cylindrical | Robinson | Sinusoidal Equal Area | Orthographic
UVA - LAW - 0708
MORTGAGE MARKET SENSITIVITY TO BANKRUPTCY MODIFICATION ADAM J. LEVITIN JOSHUA GOODMAN ABSTRACTBankruptcy has traditionally been one of the primary mechanisms used for sorting out consumer financial distress. The bankruptcy system, however, has been
UVA - LAW - 0607
State Court Debt Collection in the Old Dominion: Too Broke for Bankruptcy? Richard M. Hynes January 25, 2007 DRAFT- PLEASE DONT QUOTE OR CITE Virginia, with a population of approximately seven million, has averaged more than a million civil filings a
UVA - ASSIGN - 312
Assignment 8Problem 11. Fundamental constants from LED data. In class, we measured the threshold voltage to get appreciable light from various LEDs (red, yellow, green, blue). Use these data to obtain a rough estimate of h=e, assuming that all the
UVA - PHYS - 524
Gravitation and CosmologyLecture 8: Variational methods in mechanics and E&amp;MVariational methods in mechanics and E&amp;MElectrodynamics in Minkowski space Recall we found the equation of motion of a particle in a Lorentz vector field dp = QU F d wher
UVA - PHYS - 252
The Uncertainty PrincipleMichael Fowler University of Virginia Waves are Fuzzy As we have shown for wavepackets, the wave nature of particles implies that we cannot know both position and momentum of a particle to an arbitrary degree of accuracyif
UVA - PHYS - 252
The Lorentz TransformationsMichael Fowler, UVa Physics. 2/26/08 Problems with the Galilean Transformations We have already seen that Newtonian mechanics is invariant under the Galilean transformations relating two inertial frames moving with relativ
UVA - ASSIGN - 312
1. Explain why a transient current flows when you touch a piece of n-type semiconductor to a piece of p-type semiconductor. What is the direction of current flow? What stops the current after a while? Similar questions are in Bloomf ield, p. 439. Som
UVA - ASSIGN - 11
Assignment 11 - Problem 1Detection of plastic explosives. Plastic explosives are a favorite of terrorists due to the difficulty of detecting them. These explosives tend to contain large quantities of nitrogen. In order to detect the explosive, suppo
UVA - ASSIGN - 312
Assignment 11 - Problem 1Detection of plastic explosives. Plastic explosives are a favorite of terrorists due to the difficulty of detecting them. These explosives tend to contain large quantities of nitrogen. In order to detect the explosive, suppo
UVA - ASSIGN - 312
Assignment 10Problem 2The plasma frequency and the ionosphere. (a) Note that eq. (4.34) in Melissinos becomes equivalent to eq. (4.42) or (4.44) in the appropriate limit. What is this limit and what does it mean physically? (b) The plasma frequenc
UVA - ASSIGN - 312
Assignment 8Problem 4Fourier series. (a) Derive the Fourier series for the square wave of period 2, defined by the periodic repetition of +1 if 0 &lt; x ; f (x) = 1 if &lt; x &lt; 0: Note that f (x) is discontinuous at x = 0 and at x = . In this case,
UVA - ASSIGN - 312
Assignment 11 - Problem 2Solar temperatures. Here we will try to estimate some relevant temperatures in the sun. Assume you start with an initially diffuse cloud of hydrogen and helium atoms (initially at rest), which subsequently collapse under its
UVA - ASSIGN - 312
Assignment 10Problem 44. Lifetime of the sun. The flux of radiant energy from the sun at the surface of the earth is approximately 1:4 kW=m2 . (a) From this estimate the total power produced by nuclear reactions in the sun; from your knowledge of
UVA - ASSIGN - 312
Assignment 9Problem 5Applied diffraction. (10 points) One important physical limitation on the resolving power of an antenna is diffraction. Under ideal conditions: (a) From how high can an eagle see a mouse on the ground? (b) A diffraction-limite
UVA - ASSIGN - 312
Assignment 9Problem 3Phased antenna arrays and diffraction. (10 points) Obtain the radiation pattern shown in a `polar plot' by Melissinos in Fig. 4.4(b) and the corresponding `straight' plot of the time-averaged dP=d- versus angle , as shown in t
UVA - ASSIGN - 11
Assignment 11 - Problem 3List three radioactive nuclides that naturally occur (in easily detectable amounts) on Earth today. What are the half-lives of these nuclides? How did they originate? At least one of them should have a half-life of less than
UVA - ASSIGN - 312
Assignment 11 - Problem 3List three radioactive nuclides that naturally occur (in easily detectable amounts) on Earth today. What are the half-lives of these nuclides? How did they originate? At least one of them should have a half-life of less than
UVA - ASSIGN - 312
Assignment 9Problem 1Fourier integrals. (8 points) Suppose that an EM pulse is described by the Gaussian function 2 2 1 f(t) = p et =2 : 2 2 (a) Calculate the Fourier transform F (!) of the function f(t). If you use MAPLE, remember to say assume(s
UVA - ASSIGN - 312
Assignment 8Problem 55. Power spectrum. Here we combine the results of problems 3 and 4. (a) What is the normalized power spectrum of the square wave Vin f (!t)? (b) If the square wave is passed through the filter of problem 3a, what is the output
UVA - ASSIGN - 312
&quot; Lq d ghvnwrs hohfwurvwdwlf dlu fohdqhu/ dlu lv gulyhq wkurxjk wkh fhoo e| d idq wkdw gudzv , ` +zkhq vhw dw kljk,1 Wkh furvv vhfwlrqdo glphqvlrqv ri wkh fhoo duh 2D U4 e| D U41 Qhjohfwlqj orvvhv/ |rx fdq frpsxwh wkh vshhg ri dlu iorz/ / iurp wkhvh
UVA - ASSIGN - 312
Assignment 8Problem 22. Circuit parameters. A general circuit is characterized by the three quantities R, C, L. (a) What are the dimensions of these quantities in the SI? Optional: what are their dimensions in the gaussian system (they are a lot s
UVA - CS - 588
The Eternity ServiceRoss J. AndersonCambridge University Computer Laboratory Pembroke Street, Cambridge CB2 3QG Email: ross.anderson@cl.cam.ac.ukAbstract. The Internet was designed to provide a communications channel that is as resistant to denia
UVA - PHYS - 106
How Things Work II(Lecture #15)Instructor: Gordon D. Cates Office: Physics 106a, Phone: (434) 924-4792 email: cates@virginia.eduCourse web site available through COD and Toolkit or at http:/people.virginia.edu/~gdc4k/phys106/spring07February 19
UVA - PHYS - 106
Physics 106 - How Things Work II Course Information - Spring 2007Instructor: Text: Lectures: Oce hours: Gordon D. Cates - Professor of Physics and Radiology Oce: Physics 106A, Phone: (434) 924-4792, email: cates@virginia.edu Bloomeld, How Things Wor
UVA - PHYS - 111
Energy on this World and Elsewhere26 August 2008Preliminaries and course infoEnergy is a word that we encounter in many diverse contexts. It is a term that we encounter in newspapers, a subject that is addressed by politicians, and even an attrib
UVA - PHYS - 106
Physics 106 - How Things Work II - Tentative Syllabus for Spring 2007Lecture DATE Laws of Motion I 1 W 1/17 2 F 1/19 3 M 1/22 Laws of Motion II 4 W 1/24 5 F 1/26 6 M 1/29 7 W 1/31 8 F 2/2 Electricity 9 M 2/5 10 W 2/7 11 F 2/9 12 M 2/12 Magnetism and
UVA - PHYS - 106
Physics 106 - How Things Work II - Spring 2007 Tips for Submitting Homework via E-Class1. You must be registered for Physics 106 to enter the E-Class Site. 2. If you have recently &quot;added-in&quot;, it may take a day or so for us to add you to the E-class
UVA - PHYS - 106
Physics 106 - How Things Work II - Spring 2007 Quiz #1 February 12, 2007 Cover PagePLEASE DO NOT LOOK AT THE CONTENTS OF THIS QUIZ, OTHER THAN THIS COVER PAGE, UNTIL TOLD TO DO SO. This quiz is closed book, closed notes, and silent. You ma
UVA - PHYS - 111
Physics 111 - Energy On This World and Elsewhere - Fall 2008 Problem Set #3 with solutionsAssigned: 23 November 2008, Due: 23:59pm, 30 November 2008 Please nd below homework assignment #3. Where appropriate, you should try to show your work if you
UVA - PHYS - 111
Physics 111 - Energy On This World and Elsewhere - Fall 2008 Problem Set #2Assigned: 22 October 2008, Due: 23:59pm, 29 October 2008 Please nd below homework assignment #2. In general, you should try to show your work. Otherwise, it will not be possi
UVA - PHYS - 111
Physics 111 - Energy On This World and Elsewhere - Fall 2008 Problem Set #1Assigned: 15 September 2008, Due: 23:59pm, 23 September 2008 Please find below the first homework assignment. While you may begin work on the assignment right away, you will
UVA - PHYS - 111
Annual Energy Review 2007The Annual Energy Review (AER) is the Energy Information Administration's (EIA) primary report of annual historical energy statistics. For many series, data begin with the year 1949. Included are data on total energy product
UVA - PHYS - 111
Physics 111 - Energy On This World and Elsewhere - Fall 2008 Problem Set #1 with solutionsAssigned: 15 September 2008, Due: 23:59pm, 23 September 2008 Please find below the first homework assignment. While you may begin work on the assignment right
UVA - PHYS - 111
on this world and elsewhereInstructor: Gordon D. Cates Office: Physics 106a, Phone: (434) 924-4792 email: cates@virginia.eduEnergyCourse web site available through COD and Toolkit or at http:/people.virginia.edu/~gdc4k/phys111/fall08September 2
UVA - PHYS - 111
on this world and elsewhereInstructor: Gordon D. Cates Office: Physics 106a, Phone: (434) 924-4792 email: cates@virginia.eduEnergyCourse web site available through COD and Toolkit or at http:/people.virginia.edu/~gdc4k/phys111/fall08October 7,
UVA - PHYS - 111
on this world and elsewhereInstructor: Gordon D. Cates Office: Physics 106a, Phone: (434) 924-4792 email: cates@virginia.eduEnergyCourse web site available through COD and Toolkit or at http:/people.virginia.edu/~gdc4k/phys111/fall07November 4,
UVA - PHYS - 111
Physics 111 - Energy On This World and Elsewhere - Fall 2008 Problem Set #2 with solutionsAssigned: 22 October 2008, Due: 23:59pm, 29 October 2008 Please nd below homework assignment #2. In general, you should try to show your work. Otherwise, it w
UVA - PHYS - 111
on this world and elsewhereInstructor: Gordon D. Cates Office: Physics 106a, Phone: (434) 924-4792 email: cates@virginia.eduEnergyCourse web site available through COD and Toolkit or at http:/people.virginia.edu/~gdc4k/phys111/fall08October 21,