© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 1XXI. Object-OrientedDatabase DesignObject-Oriented Database Management Systems (OODBMS)Distributed Information Systems and CORBADesigning Data Management ClassesThe Persistent Object ApproachThe Database Broker Approach© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 2OODBMS Object-Oriented DBMS (OODBMS) are DBMS which are basedon an Object-Oriented Data Model. Such data models are often inspired by OO programminglanguages, such as SmallTalk or C++. OODBMS are capable of storing complex objects, I.e., objectsthat are composed of other objects, and/or multi-valuedattributes. The great advantage of OODBMS is that it is not necessary totransform the UML classes into a logical schema (e.g.,relational). Their main disadvantage is that their technology is immatureand they are only used in niche applications, such as CAD.© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 3OODBMS vs RDBMS RDBMS have been around for more than 20 years, OODBMSare relatively new. RDBMS can handle >1010 records, OODBMS up to 107. OODBM good for storing complex descriptions (e.g., a plantschematic), RDMSs appropriate for simple, “flat” data. RDBMS control the DB market (>90%), OODBMS own <5% ofthe market. Most commercial RDBMS come with an “Object-Relational”extension which implements an object database on top of aRDBMS.© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 4Object Database Standard Object Data Management Group has set a standard for ObjectDatabases (version 3.0). ODL - Object Definition Language OML - Object Manipulation Language However, individual ODBMS do not necessarily conform to thestandard (…usual story…)© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 5ObjectStore PSE: An OODBMS ObjectStore PSE (Persistent Storage Engine): provides persistence for Java programs; builds navigational structure into the database; requires all persistent objects to be instances of sub-classes of COM.odi.Persistent; ObjectStore provides full OODBMS functionality.© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 6Distributed Information Systems Most information systems are distributed. This means that the objects that participate in a particular use caseneed not be on the same machine with other objects and users theyare supposed to interact. One can use Remote Procedure Calls-RPC (C/C++) and RemoteMethod Invocation-RMI (Java). The object-oriented industrial standard for distributed objects isCORBA (Common Object Request Broker Architecture)© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 7CORBA CORBA separates the interface of a class from its implementation.The implementation runs on one machine, the interface can becompiled on several other machines. When accessed by a client program, an object is treated as though itis in memory on the client machine; however, the object mayactually be located on another machine. When the client program sends an object a message to invoke oneof its operations, the message and parameters are converted into aformat that can be sent over the network (marshalling) At the other end, the server unmarshals the data back into amessage with arguments, and passes these on to theimplementation of the target object. CORBA achieves this by means of programs known as ORBs(Object Request Brokers) that run on each machine. The ORBs communicate with each other by means of an Inter-ORBProtocol (IOP). Over the Internet, the protocol used is IIOP (Internet IOP).© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 8Designing Data ManagementClasses Idea is to not use a DBMS (Relational or Object-Oriented.) Instead,design data management classes which handlepersistence, caching, etc. These classes decouple applications from their persistentstorage. Use data management classes whenever you need to: Store an application object persistently; Search for or retrieve stored objects; Interface with an external database. This solution won’t work for large data sets!© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 9Data Storage Layer Options for locating the operations that handle the tasks ofstoring and retrieving objects: All persistent objects in the system could inherit methods forstorage from an abstract superclass - PersistentObject Introduce separate classes into the system whose role is todeal with the storage and retrieval of other classes(Database broker approach) © 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 10PersistentObject SuperclassApproach A superclass PersistentObject encapsulates themechanisms for an object of any class to store itself in, or retrieveitself from a database. This superclass implements operations to get an object by objectidentifier, store, delete and update objects and to iterate through aset of objects (write and read operations).© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 11PersistentObject© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 12Database Broker Approach Each persistent class could be responsible for its own storage... ...but... highly coupled (to storage mechanism); lessens class cohesion; class must now have expert knowledge of storage tasks; these are unrelated to application tasks. Solution: indirection (add a go-between). Separates the business objects from their data storageimplementation. The classes that provide the data storage services will be heldin a separate package. For each business class that needs to be persistent, there willbe an associated database broker class.© 2002 Jaelson Castro and John MylopoulosCSC340Information Systems Analysis and DesignOO Database Design 13The Broker Class The broker class provides the mechanisms to
View Full Document