1 / 85

Chapter 27

Chapter 27. Object-Oriented DBMSs - Standards and Systems Transparencies. © Pearson Education Limited 1995, 2005. Chapter 27 - Objectives. Object Management Group (OMG), CORBA, and other OMG standards. Main features of ODMG Object Standard: Object model Object Definition Language (ODL)

kezia
Download Presentation

Chapter 27

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 27 Object-Oriented DBMSs - Standards and Systems Transparencies © Pearson Education Limited 1995, 2005

  2. Chapter 27 - Objectives • Object Management Group (OMG), CORBA, and other OMG standards. • Main features of ODMG Object Standard: • Object model • Object Definition Language (ODL) • Object Query Language (OQL) • Language bindings. • Main features of ObjectStore: • Architecture • Data Definition • Data Manipulation. © Pearson Education Limited 1995, 2005

  3. Object Management Group (OMG) • International non profit-making consortium founded in 1989 to address object standards. • Several hundred member organizations including many platform and major software vendors. • Primary aims of OMG are: • Promotion of object-oriented approach. • Development of standards in which location, environment, language, and other characteristics of objects are transparent. • Not recognized standards group but aims to develop de facto standards. © Pearson Education Limited 1995, 2005

  4. Object Management Architecture Four areas identified for reference model: Object Model (OM) - Design-portable abstract model for communicating with OMG-compliant object-oriented systems. Object Request Broker (ORB) - Handle distribution of messages between application objects in a highly interoperable manner. Like distributed ‘software bus’ enabling objects to make/receive requests/responses from a provider. © Pearson Education Limited 1995, 2005

  5. Object Management Architecture Object Services - Provide main functions for realizing basic object functionality. Many of these services are database-oriented. Common Facilities - Comprise a set of tasks that many applications must perform but are traditionally duplicated within each one. © Pearson Education Limited 1995, 2005

  6. Object Reference Model © Pearson Education Limited 1995, 2005

  7. Object Model © Pearson Education Limited 1995, 2005

  8. Common Object Request Broker Architecture (CORBA) • Defines architecture of ORB-based environments. • Basis of any OMG component, defining parts that form ORB and associated structures. • Some elements of CORBA are: • Interface Definition Language (IDL). • Type model. • Interface Repository. • Methods for getting interfaces/specifications of objects. • Provides static and dynamic mechanism for clients to issue request to objects. © Pearson Education Limited 1995, 2005

  9. CORBA ORB Architecture © Pearson Education Limited 1995, 2005

  10. Other OMG Specifications • UML provides common language for describing software models. • Meta-Object Facility (MOF), defines common, abstract language for specification of metamodels. • XML Metadata Interchange (XMI) maps MOF to XML. XMI defines how XML tags are used to represent MOF-compliant models in XML. • Common Warehouse Metamodel (CWM) defines metamodel representing both business and technical metadata commonly found in data warehousing and business intelligence domains. © Pearson Education Limited 1995, 2005

  11. CWM Sub-Metamodels © Pearson Education Limited 1995, 2005

  12. CWM Relational Data Metamodel © Pearson Education Limited 1995, 2005

  13. Model-Driven Architecture (MDA) • OMG hoped OMA would be common OO middleware standard. However: • Microsoft produced DCOM (Distributed Common Object Model), • Sun developed Java, which came with its own ORB, Remote Method Invocation (RMI), • another set of middleware standards emerged with XML and SOAP (Simple Object Access Protocol). • Also e-Business increased pressure on companies to integrate their corporate databases. Enterprise Application Integration (EAI) is one of current key challenges for companies and, rather than helping, middleware may be part of problem. © Pearson Education Limited 1995, 2005

  14. Model-Driven Architecture (MDA) • MDA is an approach to system specification and interoperability building upon 4 specifications discussed above. • Based on premise that systems should be specified independent of all hardware and software details. • Thus, while software and hardware may change over time, the specification will still be applicable. • MDA addresses complete system lifecycle from analysis and design to implementation, testing, component assembly, and deployment. © Pearson Education Limited 1995, 2005

  15. Model-Driven Architecture (MDA) • To create an MDA-based application, a Platform Independent Model (PIM) is produced that represents only business functionality and behavior. • PIM can then be mapped to one or more Platform Specific Models (PSMs) to target platforms like CORBA Component Model (CCM), Enterprise JavaBeans (EJB), or Microsoft Transaction Server (MTS). • Both the PIM and the PSM are expressed using the UML. • MDA covers full range of pervasive services already specified by OMG, such as Persistence, Transactions, and Security. © Pearson Education Limited 1995, 2005

  16. Model-Driven Architecture (MDA) © Pearson Education Limited 1995, 2005

  17. Object Data Management Group • Established by vendors of OODBMSs to define standards. • Have produced an Object Model that specifies a standard model for the semantics of database objects. • Design of class libraries and applications using these semantics should be portable across various OODBMSs. © Pearson Education Limited 1995, 2005

  18. Object Data Management Group • Between release 2.0 (1997) and 3.0 (late 1999), ODMG expanded its charter to cover the specification of universal object storage standards. • At same time, ODMG changed its name from Object Database Management Group to Object Data Management Group to reflect expansion of its efforts beyond merely setting storage standards for object databases. • The Java binding was submitted to JCP as basis for Java Data Objects (JDO). • In 2001, ODMG completed its work and disbanded. © Pearson Education Limited 1995, 2005

  19. Object Data Management Group • Under its extended charter, ODMG specification covers both OODBMSs that store objects directly and Object-to-Database Mappings (ODMs) that convert and store the objects in a relational or other database system representation. • Both types of products are referred to generically as Object Data Management Systems (ODMSs). • ODMSs make database objects appear as programming language objects in one or more existing OOPLs, and extend programming language with transparently persistent data, concurrency control, recovery, associative queries, and other database capabilities. © Pearson Education Limited 1995, 2005

  20. Object Data Management Group • Major components of ODMG architecture for an OODBMS are: • Object Model (OM). • Object Definition Language (ODL). • Object Query Language (OQL). • C++, Smalltalk, and Java Language Binding. © Pearson Education Limited 1995, 2005

  21. ODMG OM - Basic Modeling Primitives • Basic modeling primitives are object/literal. • Only an object has a unique identifier. • Objects/literals can be categorized into types. • All objects of given type exhibit common behavior and state. A type is itself an object. • Behavior defined by set of operations that can be performed on or by object. • State defined by values objects carry for a set of properties. © Pearson Education Limited 1995, 2005

  22. ODMG OM - Basic Modeling Primitives • Property may be either an attribute of object or relationship between object and one or more other objects. • ODMS stores objects, enabling them to be shared by multiple users and applications. • ODMS based on a schema defined in ODL. © Pearson Education Limited 1995, 2005

  23. ODMG Object Model - Objects • Object types decomposed as atomic, collections, or structured types. • Structured types as defined in ISO SQL standard. • Objects created using new() of corresponding factory interface provided by language binding. • Each object has a unique identity, the object identifier, which does not change and is not reused when the object is deleted. • May be given one or more names by user. © Pearson Education Limited 1995, 2005

  24. Set of Built-in Types for ODMG Object Model © Pearson Education Limited 1995, 2005

  25. ODL Interface for Objects © Pearson Education Limited 1995, 2005

  26. ODMG OM - OIDs and Object Names • Each object is given a unique identity by ODMS, the object identifier, which does not change and is not reused when object is deleted. • Object may also be given one or more names that are meaningful to the user, provided each name identifies a single object within a database. • Object names act as “root” objects that provide entry points into the database. © Pearson Education Limited 1995, 2005

  27. ODMG Object Model - Objects • Lifetime of an object is orthogonal to its type (persistence is independent of type). • Lifetime specified when object is created: • Transient: object’s memory allocated and deallocated by programming language’s runtime system. • Persistent: object’s storage managed by OODBMS. © Pearson Education Limited 1995, 2005

  28. ODMG Object Model - Literals • A constant, with possibly complex structure. • Literal types decomposed as atomic, collections, structured, or null. • Values of a literal’s properties may not change. • Do not have their own identifiers and cannot stand alone as objects. • Embedded in objects and cannot be individually referenced. • Structured literals contain fixed number of named heterogeneous elements. © Pearson Education Limited 1995, 2005

  29. ODMG Object Model - Built-in Collections • Contains arbitrary number of unnamed homogeneous elements; each can be instance of atomic type, another collection, or a literal type. • Only collection objects have identity. • Use iterator to iterate over collection. • Ordered and unordered collections: • ordered: traversed first to last, or vice versa; • unordered: no fixed order of iteration. © Pearson Education Limited 1995, 2005

  30. ODMG Object Model – Built-in Collections Set: unordered collections without duplicates. Bag: unordered collections that do allow duplicates. List: ordered collections that allow duplicates. Array: 1D array of dynamically varying length. Dictionary: unordered sequence of key-value pairs with no duplicate keys. © Pearson Education Limited 1995, 2005

  31. ODL Interface for Collections © Pearson Education Limited 1995, 2005

  32. ODMG Object Model – Atomic Objects • Any user-defined object that is not a collection object is called an atomic object. • Atomic objects are represented as a class, which comprises state and behavior. • State represented by set of properties (attribute or relationship). • Attribute is not a “first class” object (i.e. not an object and so no OID). • Atomic objects can be related in a supertype/subtype lattice. © Pearson Education Limited 1995, 2005

  33. ODMG Object Model - Relationships • Only binary relationships supported. • Traversal paths are defined for each direction of traversal. class Branch { relationship set <Staff>Has inverse Staff::WorksAt} class Staff { relationship Branch WorksAt inverse Branch::Has} © Pearson Education Limited 1995, 2005

  34. ODMG Object Model - Types, Classes, Interfaces, and Inheritance • Two ways to specify types: interfaces and classes. • Interfaceis a specification that defines only abstract behavior of an object type, using operation signatures. • Behavior inheritance allows interfaces to be inherited by other interfaces/classes (but properties cannot be inherited from the interface). • Interface also noninstantiable – cannot create objects from an interface • Normally, interfaces used to specify abstract operations that can be inherited by classes or by other interfaces. © Pearson Education Limited 1995, 2005

  35. ODMG Object Model - Types, Classes, Interfaces, and Inheritance • Class defines both the abstract state and behavior of an object type, and is instantiable. • Thus, interface is an abstract concept and class an implementation concept. • Can specify single inheritance between classes using extends keyword. • Multiple inheritance not allowed using extends but is allowed using behavior inheritance. © Pearson Education Limited 1995, 2005

  36. ODMG Object Model - Types and Classes • Class definition specifies its extent and its keys: Extents - set of all instances of given type. May request ODMS maintain index to members of this set. Keys - uniquely identifies the instances of a type (similar to the concept of a candidate key). © Pearson Education Limited 1995, 2005

  37. ODMG Object Model • Object model also specifies: • Exceptions. • Metadata. • Transactions. • Databases. • Modules. © Pearson Education Limited 1995, 2005

  38. Object Definition Language (ODL) module DreamHome Class Branch (extent branchOffices key branchNo) { attribute string branchNo; …. relationship Manager ManagedBy inverse Manager::Manages; void takeOnPropertyForRent(in string propertyNo) raises(propertyAlreadyForRent); }

  39. Object Definition Language (ODL) class Person { attribute struct Pname {string fName, string lName} name; } Class Staff extends Person (extent staff key staffNo) { attribute staffNo; attribute date DOB; …. short getAge(); } © Pearson Education Limited 1995, 2005

  40. Object Definition Language (ODL) class Manager extends Staff (extent managers) { relationship Branch Manages inverse Branch::ManagedBy; } © Pearson Education Limited 1995, 2005

  41. Object Query Language (OQL) • Provides declarative access to object database using SQL-like syntax. • Does not provide explicit update operators - leaves this to operations defined on object types. • Can be used as a standalone language and as a language embedded in another language, for which an ODMG binding is defined (Smalltalk, C++, and Java). • OQL can also invoke operations programmed in these languages. © Pearson Education Limited 1995, 2005

  42. Object Query Language (OQL) • Can be used for associative and navigational access: • Associative query returns collection of objects. How these objects are located is responsibility of ODMS. • Navigational query accesses individual objects and object relationships used to navigate from one object to another. Responsibility of application program to specify procedure for accessing the objects. © Pearson Education Limited 1995, 2005

  43. Object Query Language (OQL) • An OQL query is a function that delivers an object whose type may be inferred from operator contributing to query expression. • Query definition expressions is of form: DEFINE Q as e • Defines query with name Q given query expression e. © Pearson Education Limited 1995, 2005

  44. Object Query Language (OQL) • Expression can take several forms: • Elementary - Construction • Atomic type - Object • Collection - Indexed collections • Binary set - Conversion • Query consists of a (possibly empty) set of query definition expressions followed by an expression. • Result is object with or without identity. © Pearson Education Limited 1995, 2005

  45. Example 27.2 OQL: Extents & Traversal Paths Get set of all staff (with identity) staff Get set of all branch managers (with identity) branchOffices.ManagedBy © Pearson Education Limited 1995, 2005

  46. Example 27.2 OQL: Extents & Traversal Paths Find all branches in London SELECT b.branchNo FROM b IN branchOffices WHERE b.address.city = “London”; This returns a literal of type bag<string>. © Pearson Education Limited 1995, 2005

  47. Example 27.2 OQL: Extents & Traversal Paths Assume londonBranches is named object (from last query). Find all staff who work at that branch. londonBranches.Has This returns set<SalesStaff>. © Pearson Education Limited 1995, 2005

  48. Example 27.2 OQL: Extents & Traversal Paths Because of ambiguity over return result, cannot access sales staff salaries using: londonBranches.Has.salary Result may be set<float> or bag<float>. Instead use: SELECT [DISTINCT] s.salary FROM s IN londonBranches.Has; © Pearson Education Limited 1995, 2005

  49. Example 27.3 - OQL: Use of DEFINE Get set of all staff who work in London (without identity). DEFINE Londoners AS SELECT s FROM s IN salesStaff WHERE s.WorksAt.address.city = “London”; SELECT s.name.lName FROM s IN Londoners; This returns a literal of type set<string>. © Pearson Education Limited 1995, 2005

  50. Example 27.3 - OQL: Use of DEFINE Can generalize this: DEFINE CityWorker(cityname) AS SELECT s FROM s IN salesStaff WHERE s.WorksAt.address.city = cityname; CityWorker(“London”); CityWorker(“Glasgow”); © Pearson Education Limited 1995, 2005

More Related