1 Chapter 25 Introduction to Object DBMSs Transparencies © Pearson Education Limited 1995, 2005.

Slides:



Advertisements
Similar presentations
Limitations of the relational model 1. 2 Overview application areas for which the relational model is inadequate - reasons drawbacks of relational DBMSs.
Advertisements

Object-Oriented Software Engineering Visual OO Analysis and Design
OO databases 1 Object Oriented databases. OO databases 2 Developing OODBMS - motivation motivation more and more application areas require systems that.
Chapter 10: Designing Databases
Distributed DBMS©M. T. Özsu & P. Valduriez Ch.15/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.
Introduction to Databases
Object-Oriented Analysis and Design
Introduction To System Analysis and Design
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
Chapter Object-Oriented Practices. Agenda Object-Oriented Concepts Terminology Object-Oriented Modeling Tips Object-Oriented Data Models and DBMSs.
OBJECTS Object Oriented ???????. OBJECTS Object-Oriented n OO convenient label for a collection of interconnected ideas n OO approach views computer.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
File Systems and Databases
Object-Oriented Databases
© Copyright Eliyahu Brutman Programming Techniques Course.
Introduction to Object DBMSs Transparencies © Pearson Education Limited 1995, 2005.
Oracle Database Administration
Lecture 13: Object- Oriented Concepts Anita S. Malik Adapted from Schach (2004) Chapter 7.
Object Oriented Databases - Overview
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Chapter 4 Object and Object-Relational Databases (Part ½: Object-Oriented Concepts) Lecturer: H.Ben Othmen Department of Computer Science, Umm Al-Qura.
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
The chapter will address the following questions:
Introduction To System Analysis and design
Chapter 24 Introduction to Object DBMSs Prepared by Kai Huang CS157B Prof Sin-Min Lee.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Part 3: Introduction to Object DBMSs
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
Database Design - Lecture 2
Database System Concepts and Architecture
Database Systems: Design, Implementation, and Management Ninth Edition
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
11 1 Chapter 11 Object Oriented Databases Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Chapter 1 Object-oriented DBMSs Chapters in Textbook.
DATABASE MGMT SYSTEM (BCS 1423) Chapter 5: Methodology – Conceptual Database Design.
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Chapter 11 Object-Oriented DBMSs Chapter 27, 28 & Appendix K in Textbook.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
Object_Oriented Databases, by Dr. Khalil 1 Object-Oriented Databases Dr. Awad Khalil Computer Science Department AUC.
Unified Modeling Language* Keng Siau University of Nebraska-Lincoln *Adapted from “Software Architecture and the UML” by Grady Booch.
Modeling Component-based Software Systems with UML 2.0 George T. Edwards Jaiganesh Balasubramanian Arvind S. Krishna Vanderbilt University Nashville, TN.
Object DBMSs Transparencies. ©Pearson Education 2009 Chapter 17 - Objectives Advanced database applications. Unsuitability of RDBMSs for advanced database.
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
1 CS457 Object-Oriented Databases Chapters as reference.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Object Oriented Database By Ashish Kaul References from Professor Lee’s presentations and the Web.
Onject-oriented Database Prof. Sin-Min Lee Department of Computer Science.
OOP Review CS 124.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
1 Chapter 22 Distributed DBMSs - Concepts and Design Simplified Transparencies © Pearson Education Limited 1995, 2005.
The Movement To Objects
Object-Oriented Analysis and Design
Object-Oriented Database Management System (ODBMS)
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Compiled from Connelly et al. DBMS Text
Chapter 20 Object-Oriented Analysis and Design
Design Yaodong Bi.
Presentation transcript:

1 Chapter 25 Introduction to Object DBMSs Transparencies © Pearson Education Limited 1995, 2005

2 Chapter 25 - Objectives u Advanced database applications. u Unsuitability of RDBMSs for advanced database applications. u Object-oriented concepts. u Problems of storing objects in relational database. u The next generation of database systems. u Basics of object-oriented database analysis and design. © Pearson Education Limited 1995, 2005

3 Advanced Database Applications u Computer-Aided Design/Manufacturing (CAD/CAM) u Computer-Aided Software Engineering (CASE) u Network Management Systems u Office Information Systems (OIS) and Multimedia Systems u Digital Publishing u Geographic Information Systems (GIS) u Interactive and Dynamic Web sites u Other applications with complex and interrelated objects and procedural data. © Pearson Education Limited 1995, 2005

4 Computer-Aided Design (CAD) u Stores data relating to mechanical and electrical design, for example, buildings, airplanes, and integrated circuit chips. u Designs of this type have some common characteristics: –Data has many types, each with a small number of instances. –Designs may be very large. © Pearson Education Limited 1995, 2005

5 Computer-Aided Design (CAD) –Design is not static but evolves through time. –Updates are far-reaching. –Involves version control and configuration management. –Cooperative engineering. © Pearson Education Limited 1995, 2005

6 Advanced Database Applications u Computer-Aided Manufacturing (CAM) –Stores similar data to CAD, plus data about discrete production. u Computer-Aided Software Engineering (CASE) –Stores data about stages of software development lifecycle. © Pearson Education Limited 1995, 2005

7 Network Management Systems u Coordinate delivery of communication services across a computer network. u Perform such tasks as network path management, problem management, and network planning. u Systems handle complex data and require real- time performance and continuous operation. u To route connections, diagnose problems, and balance loadings, systems have to be able to move through this complex graph in real-time. © Pearson Education Limited 1995, 2005

8 Office Information Systems (OIS) and Multimedia Systems u Stores data relating to computer control of information in a business, including electronic mail, documents, invoices, and so on. u Modern systems now handle free-form text, photographs, diagrams, audio and video sequences. u Documents may have specific structure, perhaps described using mark-up language such as SGML, HTML, or XML. © Pearson Education Limited 1995, 2005

9 Digital Publishing u Becoming possible to store books, journals, papers, and articles electronically and deliver them over high-speed networks to consumers. u As with OIS, digital publishing is being extended to handle multimedia documents consisting of text, audio, image, and video data and animation. u Amount of information available to be put online is in the order of petabytes (10 15 bytes), making them largest databases DBMS has ever had to manage. © Pearson Education Limited 1995, 2005

10 Geographic Information Systems (GIS) u GIS database stores spatial and temporal information, such as that used in land management and underwater exploration. u Much of data is derived from survey and satellite photographs, and tends to be very large. u Searches may involve identifying features based, for example, on shape, color, or texture, using advanced pattern-recognition techniques. © Pearson Education Limited 1995, 2005

11 Interactive and Dynamic Web Sites u Consider online catalog for selling clothes. Web site maintains a set of preferences for previous visitors and allows a visitor to: –obtain 3D rendering of any item based on color, size, fabric, etc.; –modify rendering to account for movement, illumination, backdrop, occasion, etc.; –select accessories to go with the outfit, from items presented in a sidebar; u Need to handle multimedia content and to interactively modify display based on user preferences and user selections. Added complexity of providing 3D rendering. © Pearson Education Limited 1995, 2005

12 Weaknesses of RDBMSs u Poor Representation of “Real World” Entities –Normalization leads to relations that do not correspond to entities in “real world”. u Semantic Overloading –Relational model has only one construct for representing data and data relationships: the relation. –Relational model is semantically overloaded. © Pearson Education Limited 1995, 2005

13 Weaknesses of RDBMSs u Poor Support for Integrity and Enterprise Constraints u Homogeneous Data Structure –Relational model assumes both horizontal and vertical homogeneity. –Many RDBMSs now allow Binary Large Objects (BLOBs). © Pearson Education Limited 1995, 2005

14 Weaknesses of RDBMSs u Limited Operations –RDBMs only have a fixed set of operations which cannot be extended. u Difficulty Handling Recursive Queries –Extremely difficult to produce recursive queries. –Extension proposed to relational algebra to handle this type of query is unary transitive (recursive) closure operation. © Pearson Education Limited 1995, 2005

15 Example - Recursive Query © Pearson Education Limited 1995, 2005

16 Weaknesses of RDBMSs u Impedance Mismatch –Most DMLs lack computational completeness. –To overcome this, SQL can be embedded in a high-level 3GL. –This produces an impedance mismatch - mixing different programming paradigms. –Estimated that as much as 30% of programming effort and code space is expended on this type of conversion. © Pearson Education Limited 1995, 2005

17 Weaknesses of RDBMSs u Other Problems with RDBMSs –Transactions are generally short-lived and concurrency control protocols not suited for long-lived transactions. –Schema changes are difficult. –RDBMSs are poor at navigational access. © Pearson Education Limited 1995, 2005

18 Object-Oriented Concepts u Abstraction, encapsulation, information hiding. u Objects and attributes. u Object identity. u Methods and messages. u Classes, subclasses, superclasses, and inheritance. u Overloading. u Polymorphism and dynamic binding. © Pearson Education Limited 1995, 2005

19 Abstraction Process of identifying essential aspects of an entity and ignoring unimportant properties. u Concentrate on what an object is and what it does, before deciding how to implement it. © Pearson Education Limited 1995, 2005

20 Encapsulation and Information Hiding Encapsulation –Object contains both data structure and set of operations used to manipulate it. Information Hiding –Separate external aspects of an object from its internal details, which are hidden from outside. u Allows internal details of an object to be changed without affecting applications that use it, provided external details remain same. u Provides data independence. © Pearson Education Limited 1995, 2005

21 Object Uniquely identifiable entity that contains both the attributes that describe the state of a real-world object and the actions associated with it. –Definition very similar to that of an entity, however, object encapsulates both state and behavior; an entity only models state. © Pearson Education Limited 1995, 2005

22 Attributes Contain current state of an object. u Attributes can be classified as simple or complex. u Simple attribute can be a primitive type such as integer, string, etc., which takes on literal values. u Complex attribute can contain collections and/or references. u Reference attribute represents relationship. u An object that contains one or more complex attributes is called a complex object. © Pearson Education Limited 1995, 2005

23 Object Identity Object identifier (OID) assigned to object when it is created that is: –System-generated. –Unique to that object. –Invariant. –Independent of the values of its attributes (that is, its state). –Invisible to the user (ideally). © Pearson Education Limited 1995, 2005

24 Object Identity - Implementation u In RDBMS, object identity is value-based: primary key is used to provide uniqueness. u Primary keys do not provide type of object identity required in OO systems: –key only unique within a relation, not across entire system; –key generally chosen from attributes of relation, making it dependent on object state. © Pearson Education Limited 1995, 2005

25 Object Identity - Implementation u Programming languages use variable names and pointers/virtual memory addresses, which also compromise object identity. u In C/C++, OID is physical address in process memory space, which is too small - scalability requires that OIDs be valid across storage volumes, possibly across different computers. u Further, when object is deleted, memory is reused, which may cause problems. © Pearson Education Limited 1995, 2005

26 Advantages of OIDs u They are efficient. u They are fast. u They cannot be modified by the user. u They are independent of content. © Pearson Education Limited 1995, 2005

27 Methods and Messages Method –Defines behavior of an object, as a set of encapsulated functions. Message –Request from one object to another asking second object to execute one of its methods. © Pearson Education Limited 1995, 2005

28 Object Showing Attributes and Methods © Pearson Education Limited 1995, 2005

29 Example of a Method © Pearson Education Limited 1995, 2005

30 Class Blueprint for defining a set of similar objects. u Objects in a class are called instances. u Class is also an object with own class attributes and class methods. © Pearson Education Limited 1995, 2005

31 Class Instance Share Attributes and Methods © Pearson Education Limited 1995, 2005

32 Subclasses, Superclasses, and Inheritance Inheritance allows one class of objects to be defined as a special case of a more general class. u Special cases are subclasses and more general cases are superclasses. u Process of forming a superclass is generalization; forming a subclass is specialization. u Subclass inherits all properties of its superclass and can define its own unique properties. u Subclass can redefine inherited methods. © Pearson Education Limited 1995, 2005

33 Subclasses, Superclasses, and Inheritance u All instances of subclass are also instances of superclass. u Principle of substitutability states that instance of subclass can be used whenever method/construct expects instance of superclass. u Relationship between subclass and superclass known as A KIND OF (AKO) relationship. u Four types of inheritance: single, multiple, repeated, and selective. © Pearson Education Limited 1995, 2005

34 Single Inheritance © Pearson Education Limited 1995, 2005

35 Multiple Inheritance © Pearson Education Limited 1995, 2005

36 Repeated Inheritance © Pearson Education Limited 1995, 2005

37 Overriding, Overloading, and Polymorphism Overriding –Process of redefining a property within a subclass. Overloading –Allows name of a method to be reused with a class or across classes. Polymorphism –Means ‘many forms’. Three types: operation, inclusion, and parametric. © Pearson Education Limited 1995, 2005

38 Example of Overriding u Might define method in Staff class to increment salary based on commission: method void giveCommission(float branchProfit) { salary = salary * branchProfit; } u May wish to perform different calculation for commission in Manager subclass: method void giveCommission(float branchProfit) { salary = salary * branchProfit; } © Pearson Education Limited 1995, 2005

39 Overloading Print Method © Pearson Education Limited 1995, 2005

40 Dynamic Binding Runtime process of selecting appropriate method based on an object’s type. u With list consisting of an arbitrary number of objects from the Staff hierarchy, we can write: list[i]. print u and runtime system will determine which print() method to invoke depending on the object’s (sub)type. © Pearson Education Limited 1995, 2005

41 Complex Objects An object that consists of subobjects but is viewed as a single object. u Objects participate in a A-PART-OF (APO) relationship. u Contained object can be encapsulated within complex object, accessed by complex object’s methods. u Or have its own independent existence, and only an OID is stored in complex object. © Pearson Education Limited 1995, 2005

42 Storing Objects in Relational Databases u One approach to achieving persistence with an OOPL is to use an RDBMS as the underlying storage engine. u Requires mapping class instances (i.e. objects) to one or more tuples distributed over one or more relations. u To handle class hierarchy, have two basics tasks to perform: (1)design relations to represent class hierarchy; (2)design how objects will be accessed. © Pearson Education Limited 1995, 2005

43 Storing Objects in Relational Databases © Pearson Education Limited 1995, 2005

44 Mapping Classes to Relations Number of strategies for mapping classes to relations, although each results in a loss of semantic information. (1) Map each class or subclass to a relation: Staff (staffNo, fName, lName, position, sex, DOB, salary) Manager (staffNo, bonus, mgrStartDate) SalesPersonnel (staffNo, salesArea, carAllowance) Secretary (staffNo, typingSpeed) © Pearson Education Limited 1995, 2005

45 Mapping Classes to Relations (2) Map each subclass to a relation Manager (staffNo, fName, lName, position, sex, DOB, salary, bonus, mgrStartDate) SalesPersonnel (staffNo, fName, lName, position, sex, DOB, salary, salesArea, carAllowance) Secretary (staffNo, fName, lName, position, sex, DOB, salary, typingSpeed) (3) Map the hierarchy to a single relation Staff (staffNo, fName, lName, position, sex, DOB, salary, bonus, mgrStartDate, salesArea, carAllowance, typingSpeed, typeFlag) © Pearson Education Limited 1995, 2005

46 Next Generation Database Systems First Generation DBMS: Network and Hierarchical –Required complex programs for even simple queries. –Minimal data independence. –No widely accepted theoretical foundation. Second Generation DBMS: Relational DBMS –Helped overcome these problems. Third Generation DBMS: OODBMS and ORDBMS. © Pearson Education Limited 1995, 2005

47 History of Data Models © Pearson Education Limited 1995, 2005

48 Object-Oriented Database Design © Pearson Education Limited 1995, 2005

49 Relationships u Relationships represented using reference attributes, typically implemented using OIDs. u Consider how to represent following binary relationships according to their cardinality: –1:1 –1:* –*:*. © Pearson Education Limited 1995, 2005

50 1:1 Relationship Between Objects A and B u Add reference attribute to A and, to maintain referential integrity, reference attribute to B. © Pearson Education Limited 1995, 2005

51 1:* Relationship Between Objects A and B u Add reference attribute to B and attribute containing set of references to A. © Pearson Education Limited 1995, 2005

52 *:* Relationship Between Objects A and B u Add attribute containing set of references to each object. u For relational database design, would decompose *:N into two 1:* relationships linked by intermediate entity. Can also represent this model in an ODBMS. © Pearson Education Limited 1995, 2005

53 *:* Relationships © Pearson Education Limited 1995, 2005

54 Alternative Design for *:* Relationships © Pearson Education Limited 1995, 2005

55 Referential Integrity Several techniques to handle referential integrity: u Do not allow user to explicitly delete objects. –System is responsible for “garbage collection”. u Allow user to delete objects when they are no longer required. –System may detect invalid references automatically and set reference to NULL or disallow the deletion. © Pearson Education Limited 1995, 2005

56 Referential Integrity u Allow user to modify and delete objects and relationships when they are no longer required. –System automatically maintains the integrity of objects. –Inverse attributes can be used to maintain referential integrity. © Pearson Education Limited 1995, 2005

57 Behavioral Design u EER approach must be supported with technique that identifies behavior of each class. u Involves identifying: –public methods: visible to all users –private methods: internal to class. u Three types of methods: –constructors and destructors –access –transform. © Pearson Education Limited 1995, 2005

58 Behavioral Design - Methods u Constructor - creates new instance of class. u Destructor - deletes class instance no longer required. u Access - returns value of one or more attributes (Get). u Transform - changes state of class instance (Put). © Pearson Education Limited 1995, 2005

59 Identifying Methods u Several methodologies for identifying methods, typically combine following approaches: –Identify classes and determine methods that may be usefully provided for each class. –Decompose application in top-down fashion and determine methods required to provide required functionality. © Pearson Education Limited 1995, 2005

60 UML u Represents unification and evolution of several OOAD methods, particularly: –Booch method, –Object Modeling Technique (OMT), –Object-Oriented Software Engineering (OOSE). u Adopted as a standard by OMG and accepted by software community as primary notation for modeling objects and components. © Pearson Education Limited 1995, 2005

61 UML u Defined as “a standard language for specifying, constructing, visualizing, and documenting the artifacts of a software system”. u The UML does not prescribe any particular methodology, but instead is flexible and customizable to fit any approach and can be used in conjunction with a wide range of software lifecycles and development processes. © Pearson Education Limited 1995, 2005

62 UML – Design Goals u Provide ready-to-use, expressive visual modeling language so users can develop and exchange meaningful models. u Provide extensibility and specialization mechanisms to extend core concepts. u Be independent of particular programming languages and development processes. u Provide a formal basis for understanding the modeling language. u Encourage growth of object-oriented tools market. u Support higher-level development concepts such as collaborations, frameworks, patterns, and components. u Integrate best practices. © Pearson Education Limited 1995, 2005

63 UML - Diagrams u Structural: –class diagrams –object diagrams –component diagrams –deployment diagrams. u Behavioral: –use case diagrams –sequence diagrams –collaboration diagrams –statechart diagrams –activity diagrams. © Pearson Education Limited 1995, 2005

64 UML – Object Diagrams u Model instances of classes and used to describe system at a particular point in time. u Can be used to validate class diagram with “real world” data and record test cases. © Pearson Education Limited 1995, 2005

65 UML – Component Diagrams u Describe organization and dependencies among physical software components, such as source code, run-time (binary) code, and executables. © Pearson Education Limited 1995, 2005

66 UML – Deployment Diagrams u Depict configuration of run-time system, showing hardware nodes, components that run on these nodes, and connections between nodes. © Pearson Education Limited 1995, 2005

67 UML – Use Case Diagrams u Model functionality provided by system (use cases), users who interact with system (actors), and association between users and the functionality. u Used in requirements collection and analysis phase to represent high-level requirements of system. u More specifically, specifies a sequence of actions, including variants, that system can perform and that yields an observable result of value to a particular actor. © Pearson Education Limited 1995, 2005

68 UML – Use Case Diagrams © Pearson Education Limited 1995, 2005

69 UML – Use Case Diagrams © Pearson Education Limited 1995, 2005

70 UML – Sequence Diagrams u Model interactions between objects over time, capturing behavior of an individual use case. u Show the objects and the messages that are passed between these objects in the use case. © Pearson Education Limited 1995, 2005

71 UML – Sequence Diagrams © Pearson Education Limited 1995, 2005

72 UML – Collaboration Diagrams u Show interactions between objects as a series of sequenced messages. u Cross between an object diagram and a sequence diagram. u Unlike sequence diagram, which has column/row format, collaboration diagram uses free-form arrangement, which makes it easier to see all interactions involving a particular object. © Pearson Education Limited 1995, 2005

73 UML – Collaboration Diagrams © Pearson Education Limited 1995, 2005

74 UML – Statechart Diagrams u Show how objects can change in response to external events. u Usually model transitions of a specific object. © Pearson Education Limited 1995, 2005

75 UML – Activity Diagrams u Model flow of control from one activity to another. u Typically represent invocation of an operation, a step in a business process, or an entire business process. u Consist of activity states and transitions between them. © Pearson Education Limited 1995, 2005

76 UML – Activity Diagrams © Pearson Education Limited 1995, 2005

77 UML – Usage in Database Design Methodology u Produce use case diagrams from requirements specification or while producing requirements specification to depict main functions required of system. Can be augmented with use case descriptions. u Produce first cut class diagram (ER model). u Produce a sequence diagram for each use case or group of related use cases. u May be useful to add a control class to class diagram to represent interface between the actors and the system. © Pearson Education Limited 1995, 2005

78 UML – Usage in Database Design Methodology u Update class diagram to show required methods in each class. u Create state diagram for each class to show how class changes state in response to messages. Messages are identified from sequence diagrams. u Revise earlier diagrams based on new knowledge gained during this process. © Pearson Education Limited 1995, 2005