Object Oriented Databases • Unsuitability of Rdbmss for Advanced Database Applications
Total Page:16
File Type:pdf, Size:1020Kb
Objectives • Advanced database applications. Object Oriented Databases • Unsuitability of RDBMSs for advanced database applications. • Object-oriented concepts. • Problems of storing objects in relational database. • The next generation of database systems. • Basics of object-oriented database analysis and design. Connolly & Begg. Chapters 25-29. Fourth edition COMP 302 Valentina Tamma Advanced Database Applications Computer-Aided Design (CAD) • Stores data relating to mechanical and electrical design, for example, buildings, airplanes, and • Computer-Aided Design/Manufacturing (CAD/CAM) integrated circuit chips. • Computer-Aided Software Engineering (CASE) • Designs of this type have some common • Network Management Systems characteristics: • Office Information Systems (OIS) and Multimedia Systems – Data has many types, each with a small number of • Digital Publishing instances. • Geographic Information Systems (GIS) – Designs may be very large • Interactive and Dynamic Web sites – Design is not static but evolves through time. • Other applications with complex and interrelated objects and – Updates are far-reaching. procedural data. – Involves version control and configuration management. – Cooperative engineering. COMP 302 Valentina Tamma COMP 302 Valentina Tamma 1 Advanced Database Applications Network Management Systems • Computer-Aided Manufacturing (CAM) • Coordinate delivery of communication services – Stores similar data to CAD, plus data about discrete across a computer network. production. • Perform such tasks as network path management, • Computer-Aided Software Engineering (CASE) problem management, and network planning. – Stores data about stages of software development lifecycle. • Systems handle complex data and require real-time performance and continuous operation. • To route connections, diagnose problems, and balance loadings, systems have to be able to move through this complex graph in real-time. COMP 302 Valentina Tamma COMP 302 Valentina Tamma Office Information Systems (OIS) and Multimedia Digital Publishing Systems • Becoming possible to store books, journals, papers, • Stores data relating to computer control of information and articles electronically and deliver them over high- in a business, including electronic mail, documents, speed networks to consumers. invoices, and so on. • As with OIS, digital publishing is being extended to • Modern systems now handle free-form text, handle multimedia documents consisting of text, photographs, diagrams, audio and video sequences. audio, image, and video data and animation. • Documents may have specific structure, perhaps • Amount of information available to be put online is in 15 described using mark-up language such as SGML, the order of petabytes (10 bytes), making them HTML, or XML. largest databases DBMS has ever had to manage. COMP 302 Valentina Tamma COMP 302 Valentina Tamma 2 Geographic Information Systems (GIS) Interactive and Dynamic Web Sites • Consider online catalog for selling clothes. Web site maintains a set of preferences for previous visitors • GIS database stores spatial and temporal and allows a visitor to: information, such as that used in land management – obtain 3D rendering of any item based on color, size, and underwater exploration. fabric, etc.; • Much of data is derived from survey and satellite – modify rendering to account for movement, illumination, photographs, and tends to be very large. backdrop, occasion, etc.; • Searches may involve identifying features based, for – select accessories to go with the outfit, from items example, on shape, color, or texture, using presented in a sidebar; advanced pattern-recognition techniques. • Need to handle multimedia content and to interactively modify display based on user preferences and user selections. Added complexity of providing 3D rendering. COMP 302 Valentina Tamma COMP 302 Valentina Tamma Weaknesses of RDBMSs Weaknesses of RDBMSs • Poor Representation of “Real World” Entities • Poor Support for Integrity and Enterprise Constraints – Normalization leads to relations that do not correspond to entities in “real world”. • Limited Operations – RDBMs only have a fixed set of operations which cannot be • Semantic Overloading extended. – Relational model has only one construct for representing data and data relationships: the relation. • Difficulty Handling Recursive Queries – Relational model is semantically overloaded. – Extremely difficult to produce recursive queries. – Extension proposed to relational algebra to handle this type of • Homogeneous Data Structure query is unary transitive (recursive) closure operation. – Relational model assumes both horizontal and vertical homogeneity. – Many RDBMSs now allow Binary Large Objects (BLOBs). COMP 302 Valentina Tamma COMP 302 Valentina Tamma 3 Example - Recursive Query Weaknesses of RDBMSs • Impedance Mismatch – Most DMLs lack computational completeness. – To overcome this, SQL can be embedded in a high-level 3rd Generation Language. – This produces an impedance mismatch - mixing different programming paradigms. – Estimated that as much as 30% of programming effort and SELECT managerstaffNo code space is expended on this type of conversion. FROM Staff WHERE staffNo=‘S005’ • Other Problems with RDBMSs UNION SELECT managerstaffNo – Transactions are generally short-lived and concurrency FROM Staff control protocols not suited for long-lived transactions. WHERE staffNo= (SELECT managerstaffNo – Schema changes are difficult. FROM Staff – RDBMSs are poor at navigational access. WHERE staffNo=‘S005’) COMP 302 Valentina Tamma COMP 302 Valentina Tamma Object-Oriented Concepts Abstraction • Abstraction, encapsulation, information hiding. • Process of identifying essential aspects of an entity and ignoring unimportant properties. • Objects and attributes. • Concentrate on what an object is and what it does, • Object identity. before deciding how to implement it. • Methods and messages. • Classes, subclasses, superclasses, and inheritance. • Overloading. • Polymorphism and dynamic binding. COMP 302 Valentina Tamma COMP 302 Valentina Tamma 4 Encapsulation and Information Hiding Object Encapsulation Uniquely identifiable entity that contains both the – Object contains both data structure and set of attributes that describe the state of a real-world object operations used to manipulate it. and the actions associated with it. Information Hiding – Definition very similar to that of an entity, however, object – Separate external aspects of an object from its encapsulates both state and behavior; an entity only models internal details, which are hidden from outside. state. • Allows internal details of an object to be changed without affecting applications that use it, provided external details remain same. • Provides data independence. COMP 302 Valentina Tamma COMP 302 Valentina Tamma Attributes Object Identity Contain current state of an object. Object identifier (OID) assigned to object when it is created that is: • Attributes can be classified as simple or complex. – System-generated. • Simple attribute can be a primitive type such as integer, string, etc., which takes on literal values. – Unique to that object. • Complex attribute can contain collections and/or – Invariant. references. – Independent of the values of its attributes (that is, its state). • Reference attribute represents relationship. – Invisible to the user (ideally). • An object that contains one or more complex attributes is called a complex object. COMP 302 Valentina Tamma COMP 302 Valentina Tamma 5 Object Identity - Implementation Object Identity - Implementation • In RDBMS, object identity is value-based: primary key • Programming languages use variable names and is used to provide uniqueness. pointers/virtual memory addresses, which also • Primary keys do not provide type of object identity compromise object identity. required in OO systems: • In C/C++, OID is physical address in process memory – key only unique within a relation, not across entire system; space, which is too small - scalability requires that – key generally chosen from attributes of relation, making it OIDs be valid across storage volumes, possibly across dependent on object state. different computers. • Further, when object is deleted, memory is reused, which may cause problems. COMP 302 Valentina Tamma COMP 302 Valentina Tamma Advantages of OIDs Methods and Messages • They are efficient. Method • They are fast. – Defines behavior of an object, as a set of encapsulated functions. • They cannot be modified by the user. • They are independent of content. Message – Request from one object to another asking second object to execute one of its methods. COMP 302 Valentina Tamma COMP 302 Valentina Tamma 6 Object Showing Attributes and Methods Example of a Method COMP 302 Valentina Tamma COMP 302 Valentina Tamma Class Class Instance Share Attributes and Methods Blueprint for defining a set of similar objects. • Objects in a class are called instances. • Class is also an object with own class attributes and class methods. • Class different from type COMP 302 Valentina Tamma COMP 302 Valentina Tamma 7 Subclasses, Superclasses, and Inheritance Subclasses, Superclasses, and Inheritance Inheritance allows one class of objects to be defined as a special case of a more general class. • All instances of subclass are also instances of superclass. • Special cases are subclasses and more general cases are superclasses. • Principle of substitutability states that instance of subclass can be used whenever method/construct • Process of forming